Clarify error message for non `@runtime_checkable` decorated protocols (#178)
diff --git a/CHANGELOG.md b/CHANGELOG.md index 74381f8..3a8bdde 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 7866555..e2b2dc6 100644 --- a/src/typing_extensions.py +++ b/src/typing_extensions.py
@@ -701,7 +701,7 @@ 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')