Skip to content

gh-92332: Docs-only deprecation of typing.Text #92351

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

Merged
merged 5 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1976,6 +1976,11 @@ Other concrete types

.. versionadded:: 3.5.2

.. deprecated:: 3.11
Python 2 is no longer supported, and most type checkers also no longer
support type checking Python 2 code. Users should now use
:class:`str` instead of ``Text`` wherever possible.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add an explicit note here saying that removal is not currently planned? A "deprecated" note can make users think it will be removed soon.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(For future readers of this PR):


Abstract Base Classes
---------------------

Expand Down Expand Up @@ -2687,3 +2692,5 @@ convenience. This is subject to change, and not all deprecations are listed.
| ``typing`` versions of standard | 3.9 | Undecided | :pep:`585` |
| collections | | | |
+----------------------------------+---------------+-------------------+----------------+
| ``typing.Text`` | 3.11 | Undecided | :gh:`92332` |
+----------------------------------+---------------+-------------------+----------------+
6 changes: 6 additions & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,12 @@ Deprecated
For now, a deprecation warning is raised for such syntax.
(Contributed by Serhiy Storchaka in :gh:`91760`.)

* :class:`typing.Text`, which exists solely to provide compatibility support
between Python 2 and Python 3 code, is now deprecated. Its removal is
currently unplanned, but users are encouraged to use :class:`str` instead
wherever possible.
(Contributed by Alex Waygood in :gh:`92332`.)


Removed
=======
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deprecate :class:`typing.Text` (removal of the class is currently not
planned). Patch by Alex Waygood.