10000 gh-74690: Further optimise `typing._ProtocolMeta.__instancecheck__` (… · warsaw/cpython@d9edf14 · GitHub
[go: up one dir, main page]

Skip to content

Commit d9edf14

Browse files
AlexWaygoodwarsaw
authored andcommitted
pythongh-74690: Further optimise typing._ProtocolMeta.__instancecheck__ (python#103280)
1 parent 5247f86 commit d9edf14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/typing.py

Lines changed: 1 addition & 1 deletion
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)
0