You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A real-world example where this matters is for instance a Protocol for NamedTuple Instances, that checks whether types.get_original_bases(cls) includes typing.NamedTuple inside __subclasshook__.
The text was updated successfully, but these errors were encountered:
I think this would be a good addition to the spec. @randolf-scholz, would you be willing to write a proposed modification to the spec and start a discussion thread to solicit comments from the broader community?
At runtime, the following members are currently excluded by
Protocol
: (source)However, neither PEP 544 nor the typing spec formalize this list, which leads to diverging behavior between different type checkers:
Code sample in pyright playground, mypy playground
Code sample in pyright playground, mypy playground
A real-world example where this matters is for instance a
Protocol
forNamedTuple
Instances, that checks whethertypes.get_original_bases(cls)
includestyping.NamedTuple
inside__subclasshook__
.The text was updated successfully, but these errors were encountered: