Message391292
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. |
|
Date |
User |
Action |
Args |
2021-04-17 17:24:23 | Kevin Shweh | set | recipients:
+ Kevin Shweh, gvanrossum, levkivskyi |
2021-04-17 17:24:23 | Kevin Shweh | set | messageid: <1618680263.88.0.942642035875.issue38908@roundup.psfhosted.org> |
2021-04-17 17:24:23 | Kevin Shweh | link | issue38908 messages |
2021-04-17 17:24:23 | Kevin Shweh | create | |
|