@@ -1825,8 +1825,9 @@ class _TypingEllipsis:
18251825
18261826_TYPING_INTERNALS = frozenset ({
18271827 '__parameters__' , '__orig_bases__' , '__orig_class__' ,
1828- '_is_protocol' , '_is_runtime_protocol' , '_is_deprecated_inherited_runtime_protocol' ,
1829- '__protocol_attrs__' , '__non_callable_proto_members__' , '__type_params__' ,
1828+ '_is_protocol' , '_is_runtime_protocol' , '__protocol_attrs__' ,
1829+ '__typing_is_deprecated_inherited_runtime_protocol__' ,
1830+ '__non_callable_proto_members__' , '__type_params__' ,
18301831})
18311832
18321833_SPECIAL_NAMES = frozenset ({
@@ -2015,7 +2016,7 @@ def __subclasscheck__(cls, other):
20152016 "Instance and class checks can only be used with "
20162017 "@runtime_checkable protocols"
20172018 )
2018- if getattr (cls , '_is_deprecated_inherited_runtime_protocol ' , False ):
2019+ if getattr (cls , '__typing_is_deprecated_inherited_runtime_protocol__ ' , False ):
20192020 # See GH-132604.
20202021 import warnings
20212022 depr_message = (
@@ -2054,7 +2055,7 @@ def __instancecheck__(cls, instance):
20542055 raise TypeError ("Instance and class checks can only be used with"
20552056 " @runtime_checkable protocols" )
20562057
2057- if getattr (cls , '_is_deprecated_inherited_runtime_protocol ' , False ):
2058+ if getattr (cls , '__typing_is_deprecated_inherited_runtime_protocol__ ' , False ):
20582059 # See GH-132604.
20592060 import warnings
20602061
@@ -2161,7 +2162,7 @@ def __init_subclass__(cls, *args, **kwargs):
21612162 # Mark inherited runtime checkability (deprecated). See GH-132604.
21622163 if cls ._is_protocol and getattr (cls , '_is_runtime_protocol' , False ):
21632164 # This flag is set to False by @runtime_checkable.
2164- cls ._is_deprecated_inherited_runtime_protocol = True
2165+ cls .__typing_is_deprecated_inherited_runtime_protocol__ = True
21652166
21662167 # Set (or override) the protocol subclass hook.
21672168 if '__subclasshook__' not in cls .__dict__ :
@@ -2310,8 +2311,8 @@ def close(self): ...
23102311 ' got %r' % cls )
23112312 cls ._is_runtime_protocol = True
23122313 # See GH-132604.
2313- if hasattr (cls , '_is_deprecated_inherited_runtime_protocol ' ):
2314- cls ._is_deprecated_inherited_runtime_protocol = False
2314+ if hasattr (cls , '__typing_is_deprecated_inherited_runtime_protocol__ ' ):
2315+ cls .__typing_is_deprecated_inherited_runtime_protocol__ = False
23152316 # PEP 544 prohibits using issubclass()
23162317 # with protocols that have non-method members.
23172318 # See gh-113320 for why we compute this attribute here,
0 commit comments