This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Kevin Shweh
Recipients Kevin Shweh, gvanrossum, levkivskyi
Date 2021-04-17.17:24:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618680263.88.0.942642035875.issue38908@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-04-17 17:24:23Kevin Shwehsetrecipients: + Kevin Shweh, gvanrossum, levkivskyi
2021-04-17 17:24:23Kevin Shwehsetmessageid: <1618680263.88.0.942642035875.issue38908@roundup.psfhosted.org>
2021-04-17 17:24:23Kevin Shwehlinkissue38908 messages
2021-04-17 17:24:23Kevin Shwehcreate