isinstance check with nested Protocol.
#1257
Labels
topic: feature
Discussions about new features for Python's type annotations
nstarman commentedSep 17, 2022
isinstance(obj, ProtocolSubclass)only checks the the existence ofProtocolSubclass's methods onobjand not the type signature. To provide deeper checks, maybeisinstancecould check attributes/methods onProtocolSubclassthat are themselves aProtocol.A small example showing the change in behavior:
The text was updated successfully, but these errors were encountered: