Skip to content

Commit 6f18b86

Browse files
gh-92332: Docs-only deprecation of typing.Text (GH-92351)
Co-authored-by: Shantanu <[email protected]>
1 parent cbc2c19 commit 6f18b86

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Doc/library/typing.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1976,6 +1976,11 @@ Other concrete types
19761976

19771977
.. versionadded:: 3.5.2
19781978

1979+
.. deprecated:: 3.11
1980+
Python 2 is no longer supported, and most type checkers also no longer
1981+
support type checking Python 2 code. Users should now use
1982+
:class:`str` instead of ``Text`` wherever possible.
1983+
19791984
Abstract Base Classes
19801985
---------------------
19811986

@@ -2687,3 +2692,5 @@ convenience. This is subject to change, and not all deprecations are listed.
26872692
| ``typing`` versions of standard | 3.9 | Undecided | :pep:`585` |
26882693
| collections | | | |
26892694
+----------------------------------+---------------+-------------------+----------------+
2695+
| ``typing.Text`` | 3.11 | Undecided | :gh:`92332` |
2696+
+----------------------------------+---------------+-------------------+----------------+

Doc/whatsnew/3.11.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,12 @@ Deprecated
12021202
For now, a deprecation warning is raised for such syntax.
12031203
(Contributed by Serhiy Storchaka in :gh:`91760`.)
12041204

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

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

0 commit comments

Comments
 (0)