Skip to content

Commit

Permalink
pythongh-74690: Further optimise `typing._ProtocolMeta.__instancechec…
Browse files Browse the repository at this point in the history
…k__` (python#103280)
  • Loading branch information
AlexWaygood authored and warsaw committed Apr 11, 2023
1 parent 5247f86 commit d9edf14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2039,7 +2039,7 @@ def __instancecheck__(cls, instance):
val = getattr_static(instance, attr)
except AttributeError:
break
if callable(getattr(cls, attr, None)) and val is None:
if val is None and callable(getattr(cls, attr, None)):
break
else:
return True
Expand Down

0 comments on commit d9edf14

Please sign in to comment.