Skip to content
Prev Previous commit
Next Next commit
Improve deprecation comments
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
michael-the1 and AlexWaygood committed Jul 25, 2023
commit 0d2d4b00c40e34dc5f0687d009effe0052d20ac9
7 changes: 6 additions & 1 deletion Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,16 @@ using ``[]``.

.. data:: AnyStr

.. deprecated:: 3.13
.. deprecated-removed:: 3.13 3.18
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

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
6 changes: 3 additions & 3 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ Deprecated
has yet to be supported by any major type checkers.
(Contributed by Alex Waygood in :gh:`106309`.)

* :class:`typing.AnyStr` is deprecated in docs since Python 3.13. The intention
is to remove ``AnyStr`` from ``__all__`` and emit a :exc:`DeprecationWarning`
in Python 3.16, and to remove ``AnyStr`` entirely in Python 3.18.
* :data:`typing.AnyStr` is deprecated. In Python 3.16, it will be removed from
``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted when it
is imported or accessed. It will be removed entirely in Python 3.18.
(Contributed by Michael The in :gh:`107116`.)
Comment thread
michael-the1 marked this conversation as resolved.

* :mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()``
Expand Down