Avoid using deprecated typing aliases in importlib
#129490
Labels
Content-Length: 243341 | pFad | http://github.com/python/cpython/issues/129490
37importlib
#129490
Fetched URL: http://github.com/python/cpython/issues/129490
Alternative Proxies:
Feature or enhancement
Proposal:
In the documentation it is written:
https://docs.python.org/3.14/library/typing.html#deprecated-aliases
The redundant types are deprecated as of Python 3.9. However, while the aliases may be removed at some point, removal of these aliases is not currently planned. As such, no deprecation warnings are currently issued by the interpreter for these aliases.
If at some point it is decided to remove these deprecated aliases, a deprecation warning will be issued by the interpreter for at least two releases prior to removal. The aliases are guaranteed to remain in the typing module without deprecation warnings until at least Python 3.14.
For importlib, there are already type annotations, and in the previous discussion it was felt that type annotations should be kept
See https://discuss.python.org/t/static-type-annotations-in-cpython/65068
I'd like to clean up typing aliases that have been deprecated since python 3.9, although they won't have warnings at the moment. However, in the long run, for example, if a deprecation warning is prompted after 5 years, it will be a burden on the maintenance of stdlib.
For example,
from typing import List
It can be replaced with a
list
of_builtin
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
importlib
#129491The text was updated successfully, but these errors were encountered: