Skip to content
Next Next commit
Deprecate AnyStr in the docs
  • Loading branch information
michael-the1 committed Jul 23, 2023
commit 9cd2b0f56503b539a8f3cc86297fbe1e42b78e4c
5 changes: 5 additions & 0 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,11 @@ using ``[]``.

.. data:: AnyStr

.. deprecated:: 3.13
Comment thread
michael-the1 marked this conversation as resolved.
Outdated
Deprecated in favor of the new type parameter syntax. Use
``class A[T: (str, bytes)]: ...`` instead of importing ``AnyStr``. See
:pep:`695` for more details.
Comment thread
michael-the1 marked this conversation as resolved.
Outdated
Comment thread
michael-the1 marked this conversation as resolved.
Outdated

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

Definition::
Expand Down