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