Target python version based deprecation warnings for stdlib types #2300
FasterSpeeding
started this conversation in
Ideas
Replies: 1 comment 5 replies
-
I think this is a reasonable piece of functionality to include in pyright. PEP 585 is clear that these symbols are deprecated as of Python 3.9. Please feel free to file an enhancement request. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've not looked too deeply into this so I'm not sure if this might be considered outside the scope of pyright or come down to an issue of there not being any consistent listing for deprecated types per python version to use but recently I've been trying to switch from the generic alias present in the
typing
module to theircollections.abc
equivalents as part of a move to python 3.9 and I'm kind of struggling to avoid accidentally using the deprecated typing equivalents by instinct. I thought that it'd be a helpful feature for pyright to support warnings when deprecated types are detected like this to help developers avoid using deprecated types and also help improve awareness of when you're using deprecated types (e.g. bumped the minimum required target for a project) in type hints where they won't necessarily give off deprecation warnings at runtime.I know in a best case scenario developers would just be aware of what's deprecated from reading changelogs but we're only humans and it'd be really helpful to dumb mistakes and missing stuff.
Beta Was this translation helpful? Give feedback.
All reactions