Skip to content

Commit 1f3c6b4

Browse files
committed
Address review
1 parent 9d9d3df commit 1f3c6b4

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

Doc/library/typing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ using ``[]``.
900900
:pep:`695` for more details.
901901

902902
Since Python 3.16, ``AnyStr`` is removed from ``typing.__all__``, and
903-
deprecation warnings is emitted at runtime when it is accessed or
903+
deprecation warnings are emitted at runtime when it is accessed or
904904
imported from ``typing``. ``AnyStr`` will be removed from ``typing``
905905
in Python 3.18.
906906

Lib/typing.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3922,7 +3922,15 @@ def __subclasscheck__(self, cls):
39223922
elif attr == "AnyStr":
39233923
import warnings
39243924

3925-
warnings._deprecated("typing.AnyStr", remove=(3, 18))
3925+
warnings._deprecated(
3926+
"typing.AnyStr",
3927+
message=(
3928+
"{name!r} is deprecated and slated for removal "
3929+
"in Python {remove}. Use PEP-695 type parameters "
3930+
"with constraints instead"
3931+
),
3932+
remove=(3, 18),
3933+
)
39263934
AnyStr = globals()["AnyStr"] = TypeVar('AnyStr', bytes, str)
39273935
return AnyStr
39283936
else:

0 commit comments

Comments
 (0)