@@ -288,8 +288,7 @@ def call_after(
288
288
# LoggingTransaction isn't expecting there to be any callbacks; assert that
289
289
# is not the case.
290
290
assert self .after_callbacks is not None
291
- # type-ignore: need mypy containing https://github.com/python/mypy/pull/12668
292
- self .after_callbacks .append ((callback , args , kwargs )) # type: ignore[arg-type]
291
+ self .after_callbacks .append ((callback , args , kwargs ))
293
292
294
293
def async_call_after (
295
294
self , callback : Callable [P , Awaitable ], * args : P .args , ** kwargs : P .kwargs
@@ -310,8 +309,7 @@ def async_call_after(
310
309
# LoggingTransaction isn't expecting there to be any callbacks; assert that
311
310
# is not the case.
312
311
assert self .async_after_callbacks is not None
313
- # type-ignore: need mypy containing https://github.com/python/mypy/pull/12668
314
- self .async_after_callbacks .append ((callback , args , kwargs )) # type: ignore[arg-type]
312
+ self .async_after_callbacks .append ((callback , args , kwargs ))
315
313
316
314
def call_on_exception (
317
315
self , callback : Callable [P , object ], * args : P .args , ** kwargs : P .kwargs
@@ -329,8 +327,7 @@ def call_on_exception(
329
327
# LoggingTransaction isn't expecting there to be any callbacks; assert that
330
328
# is not the case.
331
329
assert self .exception_callbacks is not None
332
- # type-ignore: need mypy containing https://github.com/python/mypy/pull/12668
333
- self .exception_callbacks .append ((callback , args , kwargs )) # type: ignore[arg-type]
330
+ self .exception_callbacks .append ((callback , args , kwargs ))
334
331
335
332
def fetchone (self ) -> Optional [Tuple ]:
336
333
return self .txn .fetchone ()
@@ -411,10 +408,7 @@ def _do_execute(
411
408
sql = self .database_engine .convert_param_style (sql )
412
409
if args :
413
410
try :
414
- # The type-ignore should be redundant once mypy releases a version with
415
- # https://github.com/python/mypy/pull/12668. (`args` might be empty,
416
- # (but we'll catch the index error if so.)
417
- sql_logger .debug ("[SQL values] {%s} %r" , self .name , args [0 ]) # type: ignore[index]
411
+ sql_logger .debug ("[SQL values] {%s} %r" , self .name , args [0 ])
418
412
except Exception :
419
413
# Don't let logging failures stop SQL from working
420
414
pass
@@ -646,19 +640,15 @@ def new_transaction(
646
640
# For now, we just log an error, and hope that it works on the first attempt.
647
641
# TODO: raise an exception.
648
642
649
- # Type-ignore Mypy doesn't yet consider ParamSpec.args to be iterable; see
650
- # https://github.com/python/mypy/pull/12668
651
- for i , arg in enumerate (args ): # type: ignore[arg-type, var-annotated]
643
+ for i , arg in enumerate (args ):
652
644
if inspect .isgenerator (arg ):
653
645
logger .error (
654
646
"Programming error: generator passed to new_transaction as "
655
647
"argument %i to function %s" ,
656
648
i ,
657
649
func ,
658
650
)
659
- # Type-ignore Mypy doesn't yet consider ParamSpec.args to be a mapping; see
660
- # https://github.com/python/mypy/pull/12668
661
- for name , val in kwargs .items (): # type: ignore[attr-defined]
651
+ for name , val in kwargs .items ():
662
652
if inspect .isgenerator (val ):
663
653
logger .error (
664
654
"Programming error: generator passed to new_transaction as "
0 commit comments