@@ -290,8 +290,7 @@ def call_after(
290290 # LoggingTransaction isn't expecting there to be any callbacks; assert that
291291 # is not the case.
292292 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 ))
295294
296295 def async_call_after (
297296 self , callback : Callable [P , Awaitable ], * args : P .args , ** kwargs : P .kwargs
@@ -312,8 +311,7 @@ def async_call_after(
312311 # LoggingTransaction isn't expecting there to be any callbacks; assert that
313312 # is not the case.
314313 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 ))
317315
318316 def call_on_exception (
319317 self , callback : Callable [P , object ], * args : P .args , ** kwargs : P .kwargs
@@ -331,8 +329,7 @@ def call_on_exception(
331329 # LoggingTransaction isn't expecting there to be any callbacks; assert that
332330 # is not the case.
333331 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 ))
336333
337334 def fetchone (self ) -> Optional [Tuple ]:
338335 return self .txn .fetchone ()
@@ -421,10 +418,7 @@ def _do_execute(
421418 sql = self .database_engine .convert_param_style (sql )
422419 if args :
423420 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 ])
428422 except Exception :
429423 # Don't let logging failures stop SQL from working
430424 pass
@@ -655,19 +649,15 @@ def new_transaction(
655649 # For now, we just log an error, and hope that it works on the first attempt.
656650 # TODO: raise an exception.
657651
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 ):
661653 if inspect .isgenerator (arg ):
662654 logger .error (
663655 "Programming error: generator passed to new_transaction as "
664656 "argument %i to function %s" ,
665657 i ,
666658 func ,
667659 )
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 ():
671661 if inspect .isgenerator (val ):
672662 logger .error (
673663 "Programming error: generator passed to new_transaction as "
0 commit comments