Kevin Shweh <[email protected]> added the comment:
It seems like the straightforward, minimal fix would be to just add
if (getattr(cls, '_is_protocol', False) and
not getattr(cls, '_is_runtime_protocol', False) and
not _allow_reckless_class_cheks()):
raise TypeError(...)
to _ProtocolMeta.__instancecheck__. Does that fail on some edge case (that the
current implementation works on)? It's a little weird that
_ProtocolMeta.__instancecheck__ doesn't explicitly check that the protocol is
runtime-checkable.
----------
nosy: +Kevin Shweh
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue38908>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com