Skip to content

Commit b306e56

Browse files
authored
Clarify error message for non @runtime_checkable decorated protocols (#178)
1 parent 356934c commit b306e56

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Unreleased
2+
3+
- Change deprecated `@runtime` to formal API `@runtime_checkable` in the error
4+
message. Patch by Xuehai Pan.
5+
16
# Release 4.6.0 (May 22, 2023)
27

38
- `typing_extensions` is now documented at

src/typing_extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def _proto_hook(other):
701701
if _allow_reckless_class_checks():
702702
return NotImplemented
703703
raise TypeError("Instance and class checks can only be used with"
704-
" @runtime protocols")
704+
" @runtime_checkable protocols")
705705
if not isinstance(other, type):
706706
# Same error as for issubclass(1, int)
707707
raise TypeError('issubclass() arg 1 must be a class')

0 commit comments

Comments
 (0)