From 65757ba6d6e6091f6138d1389ed8974a14580258 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Thu, 13 May 2021 23:47:46 +0200 Subject: [PATCH 1/3] Remove mention of typing.io and typing.re again They were originally removed in GH-10173 per bpo-35089, but then readded in GH-21574. Cf. bpo-38291 for decision to remove. --- Doc/library/typing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index ba79bb7ed75ff7..4a3d910a9d3d8b 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1488,7 +1488,7 @@ Other concrete types Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and ``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned by - :func:`open`. These types are also in the ``typing.io`` namespace. + :func:`open`. .. class:: Pattern Match @@ -1498,7 +1498,7 @@ Other concrete types :func:`re.match`. These types (and the corresponding functions) are generic in ``AnyStr`` and can be made specific by writing ``Pattern[str]``, ``Pattern[bytes]``, ``Match[str]``, or - ``Match[bytes]``. These types are also in the ``typing.re`` namespace. + ``Match[bytes]``. .. deprecated:: 3.9 Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. From d0ee63719db54fbb044b9828a513b9bc91947e87 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 14 May 2021 11:19:43 +0200 Subject: [PATCH 2/3] Add deprecated notice about typing.{io,re} --- Doc/library/typing.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 4a3d910a9d3d8b..e9980a7745d694 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1490,6 +1490,10 @@ Other concrete types represent the types of I/O streams such as returned by :func:`open`. + .. deprecated-removed:: 3.8 3.12 + These types are also in the ``typing.io`` namespace, which was + never supported by type checkers and will be removed. + .. class:: Pattern Match @@ -1500,6 +1504,10 @@ Other concrete types ``Pattern[str]``, ``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``. + .. deprecated-removed:: 3.8 3.12 + These types are also in the ``typing.re`` namespace, which was + never supported by type checkers and will be removed. + .. deprecated:: 3.9 Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :pep:`585` and :ref:`types-genericalias`. From 824e178a1910549685645ed647dac305beea8b66 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 14 Jun 2021 09:20:55 +0200 Subject: [PATCH 3/3] Add NEWS entry --- .../next/Documentation/2021-06-14-09-20-37.bpo-38291.VMYa_Q.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Documentation/2021-06-14-09-20-37.bpo-38291.VMYa_Q.rst diff --git a/Misc/NEWS.d/next/Documentation/2021-06-14-09-20-37.bpo-38291.VMYa_Q.rst b/Misc/NEWS.d/next/Documentation/2021-06-14-09-20-37.bpo-38291.VMYa_Q.rst new file mode 100644 index 00000000000000..23ce35eb176d9d --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-06-14-09-20-37.bpo-38291.VMYa_Q.rst @@ -0,0 +1,2 @@ +Mark ``typing.io`` and ``typing.re`` as deprecated since Python 3.8 in the +documentation. They were never properly supported by type checkers.