diff --git a/CHANGELOG.md b/CHANGELOG.md index 74381f8a..3a8bddeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# Unreleased + +- Change deprecated `@runtime` to formal API `@runtime_checkable` in the error + message. Patch by Xuehai Pan. + # Release 4.6.0 (May 22, 2023) - `typing_extensions` is now documented at diff --git a/src/typing_extensions.py b/src/typing_extensions.py index 78665556..e2b2dc6a 100644 --- a/src/typing_extensions.py +++ b/src/typing_extensions.py @@ -701,7 +701,7 @@ def _proto_hook(other): if _allow_reckless_class_checks(): return NotImplemented raise TypeError("Instance and class checks can only be used with" - " @runtime protocols") + " @runtime_checkable protocols") if not isinstance(other, type): # Same error as for issubclass(1, int) raise TypeError('issubclass() arg 1 must be a class')