]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-92332: Docs-only deprecation of `typing.Text` (GH-92351)
authorAlex Waygood <Alex.Waygood@Gmail.com>
Fri, 6 May 2022 10:15:18 +0000 (11:15 +0100)
committerGitHub <noreply@github.com>
Fri, 6 May 2022 10:15:18 +0000 (18:15 +0800)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Doc/library/typing.rst
Doc/whatsnew/3.11.rst
Misc/NEWS.d/next/Library/2022-05-05-22-46-52.gh-issue-92332.Fv9CJx.rst [new file with mode: 0644]

index 88085594caaff2403e66a8e263d2febeb0d899bb..005a515234110fe3440f4ba0568dec9ace62be61 100644 (file)
@@ -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.
+
 Abstract Base Classes
 ---------------------
 
@@ -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`    |
++----------------------------------+---------------+-------------------+----------------+
index 19ac8676ba638c2641c143ecc32fe34605db5c2a..f679100863a031101dae6556500425cbd65599af 100644 (file)
@@ -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
 =======
diff --git a/Misc/NEWS.d/next/Library/2022-05-05-22-46-52.gh-issue-92332.Fv9CJx.rst b/Misc/NEWS.d/next/Library/2022-05-05-22-46-52.gh-issue-92332.Fv9CJx.rst
new file mode 100644 (file)
index 0000000..1d055bb
--- /dev/null
@@ -0,0 +1,2 @@
+Deprecate :class:`typing.Text` (removal of the class is currently not
+planned). Patch by Alex Waygood.