Skip to content

Commit de18267

Browse files
authored
gh-74690: Further optimise typing._ProtocolMeta.__instancecheck__ (#103280)
1 parent 96e1901 commit de18267

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/typing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,7 @@ def __instancecheck__(cls, instance):
20392039
val = getattr_static(instance, attr)
20402040
except AttributeError:
20412041
break
2042-
if callable(getattr(cls, attr, None)) and val is None:
2042+
if val is None and callable(getattr(cls, attr, None)):
20432043
break
20442044
else:
20452045
return True

0 commit comments

Comments
 (0)