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
The typing module has a huge API, and new features continue to be added in each version of Python. Deprecations should be done carefully and slowly, to minimise disruption for users, but we should nonetheless aim to shrink the API where features are no longer needed, so as to make the sheer size of the module less overwhelming for newcomers to Python typing.
Python 2.7 is now end-of-life, so typing.Text has no use anymore (its sole purpose was to provide backwards compatibility with Python 2). I propose that we should now deprecate typing.Text, with a view to eventually removing it.
I agree on deprecating Text and removing it from examples, but I don't want to remove it for a long time: that just needlessly breaks previously working code.
To reduce cognitive load on readers of the typing module docs, we can eventually move it to a separate section about deprecated names and cover it only briefly.
Please forgive my ignorance: I didn't even know typing.Text existed. I don't think many people still use this, so we can deprecate it (but like you mentioned, remove it a long long time later).
To be clear, by "a long time" I mean something like "wait a decade and then maybe start thinking about removing it". We shouldn't set a concrete removal timeline yet.
Reacted by Alex Waygood
Reacted by Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
Activity
JelleZijlstra commentedon May 5, 2022
I agree on deprecating
Textand removing it from examples, but I don't want to remove it for a long time: that just needlessly breaks previously working code.To reduce cognitive load on readers of the
typingmodule docs, we can eventually move it to a separate section about deprecated names and cover it only briefly.AlexWaygood commentedon May 5, 2022
We agree.
Fidget-Spinner commentedon May 5, 2022
Please forgive my ignorance: I didn't even know
typing.Textexisted. I don't think many people still use this, so we can deprecate it (but like you mentioned, remove it a long long time later).JelleZijlstra commentedon May 5, 2022
It's pretty easy to miss :).
To be clear, by "a long time" I mean something like "wait a decade and then maybe start thinking about removing it". We shouldn't set a concrete removal timeline yet.
AlexWaygood commentedon May 5, 2022
It's definitely not a big maintenance burden or anything!
gh-92332: Docs-only deprecation of `typing.Text` (GH-92351)
`typing.Text` is deprecated
`typing.Text` is deprecated (#27)