Deprecated type hints #2887
Unanswered
tanguyMichardiere
asked this question in
Potential Issue
Replies: 1 comment
-
Most of our imports are |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
According to PEP 585, type hints such as
typing.List
ortyping.Callable
(among others) are deprecated and should be replaced withlist
andcollections.abc.Callable
respectively.The PEP states:
"The deprecated functionality may eventually be removed from the typing module. Removal will occur no sooner than Python 3.9’s end of life, scheduled for October 2025", which means Starlette may cause errors under Python 3.14 in a few months.
As Starlette requires Python >=3.9, replacing these type hints would not be a breaking change, as far as I understand.
Ruff's UP006 rule could help migrating.
Beta Was this translation helpful? Give feedback.
All reactions