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
{{ message }}
Repository navigation
--python-version 3.9 should warn about generic usages #10971
The redundant types are deprecated as of Python 3.9 but no deprecation warnings will be issued by the interpreter. It is expected that type checkers will flag the deprecated types when the checked program targets Python 3.9 or newer.
However that does not seem to be the case with mypy even if it's run with --python-version 3.9.
Pitch
Currently there is no way to learn about these deprecation warnings in automated way, because they're not issued by anything, which makes making the code future-proof a hassle.
Activity
rr- commentedon Aug 11, 2021
Here's an initial patch that adds such warnings and breaks half of the Python ecosystem
use collections.abc over typing
Avasam commentedon May 18, 2026
FYI mypy 2.0 has dropped support for Python 3.9, so this shouldn't need 3.9-specific special casing:
--python-version 3.9#21243JelleZijlstra commentedon May 18, 2026
This is also relevant to newer versions, right?
Though in practice, linters (e.g. Ruff, pyupgrade) warn about this instead, so there isn't a strong need for mypy to do it too.
Avasam commentedon May 18, 2026
For class and function symbols typeshed can add deprecated decorators (even if not decorated as such at runtime) added in Python 3.13 (but backportable for static typing)
and mypy has https://mypy.readthedocs.io/en/stable/error_code_list2.html#check-that-imported-or-used-feature-is-deprecated-deprecated
So yeah, I don't think there's any special casing needed from mypy anymore.
JelleZijlstra commentedon May 18, 2026
We can't add deprecated decorators for things like
typing.Listin typeshed though.