Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Small fixups
  • Loading branch information
AlexWaygood committed Jul 31, 2023
commit 8e32e2968f601b3a4e8a08c9872d2412174013d3
20 changes: 10 additions & 10 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -831,16 +831,6 @@ using ``[]``.

.. data:: AnyStr

.. deprecated-removed:: 3.13 3.18
Deprecated in favor of the new :ref:`type parameter syntax <type-params>`.
Use ``class A[T: (str, bytes)]: ...`` instead of importing ``AnyStr``. See
:pep:`695` for more details.

In Python 3.16, ``AnyStr`` will be removed from ``typing.__all__``, and
deprecation warnings will be emitted at runtime when it is accessed or
imported from ``typing``. ``AnyStr`` will be removed from ``typing``
in Python 3.18.

A :ref:`constrained type variable <typing-constrained-typevar>`.

Definition::
Expand Down Expand Up @@ -874,6 +864,16 @@ using ``[]``.
def greet_proper(cond: bool) -> str | bytes:
return "hi there!" if cond else b"greetings!"

.. deprecated-removed:: 3.13 3.18
Deprecated in favor of the new :ref:`type parameter syntax <type-params>`.
Use ``class A[T: (str, bytes)]: ...`` instead of importing ``AnyStr``. See
:pep:`695` for more details.

In Python 3.16, ``AnyStr`` will be removed from ``typing.__all__``, and
deprecation warnings will be emitted at runtime when it is accessed or
imported from ``typing``. ``AnyStr`` will be removed from ``typing``
in Python 3.18.

.. data:: LiteralString

Special type that includes only literal strings.
Expand Down
5 changes: 0 additions & 5 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,6 @@ Pending Removal in Python 3.16
* :class:`array.array` ``'u'`` type (:c:type:`wchar_t`):
use the ``'w'`` type instead (``Py_UCS4``).

Pending Removal in Python 3.18
------------------------------

* :class:`typing.AnyStr`: Use the new :ref:`type parameter syntax <type-params>` instead. See :pep:`695`. (:gh:`105578`)

Pending Removal in Future Versions
----------------------------------

Expand Down