You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mypy has the ability to selectively ignore type errors with special syntax in a type annotation comment. These comments confuse pyflakes and cause it to emit spurious "undefined name" errors.
Sample code using this mypy feature:
def foo(a: str):
if a == 37:
return ""
return a + ""
foo(37) # type: ignore[arg-type]
mypy has the ability to selectively ignore type errors with special syntax in a type annotation comment. These comments confuse pyflakes and cause it to emit spurious "undefined name" errors.
Sample code using this mypy feature:
(See https://mypy.readthedocs.io/en/latest/error_codes.html#silencing-errors-based-on-error-codes for more detail.)
pyflakes reports undefined names in that type annotation comment:
If I change the type annotation comment to
then pyflakes is happy. But I'm not happy, because that will prevent mypy from finding other errors in this line.
The text was updated successfully, but these errors were encountered: