X Tutup
The Wayback Machine - https://web.archive.org/web/20220616074319/https://github.com/python/cpython/issues/92332
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate typing.Text #92332

Closed
AlexWaygood opened this issue May 5, 2022 · 5 comments · Fixed by #92351
Closed

Deprecate typing.Text #92332

AlexWaygood opened this issue May 5, 2022 · 5 comments · Fixed by #92351
Labels
expert-typing type-feature

Comments

@AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented May 5, 2022

Feature or enhancement

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.

@AlexWaygood AlexWaygood added type-feature expert-typing labels May 5, 2022
@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented May 5, 2022

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.

@AlexWaygood
Copy link
Member Author

@AlexWaygood AlexWaygood commented May 5, 2022

I don't want to remove it for a long time: that just needlessly breaks previously working code.

We agree.

@Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented May 5, 2022

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).

@JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented 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
Copy link
Member Author

@AlexWaygood AlexWaygood commented May 5, 2022

It's pretty easy to miss :).

It's definitely not a big maintenance burden or anything!

Fidget-Spinner pushed a commit that referenced this issue May 6, 2022
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expert-typing type-feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
X Tutup