Skip to content

Commit 0f75d98

Browse files
committed
Finalize the logic
1 parent c497857 commit 0f75d98

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/functools.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,12 +900,13 @@ def _get_dispatch_param(func, *, _dispatchmethod=False):
900900
idx = 0
901901
func = func.__func__
902902
elif isinstance(func, classmethod):
903+
idx = 1
903904
func = func.__func__
905+
elif _dispatchmethod and not isinstance(func, MethodType):
904906
idx = 1
905-
elif _dispatchmethod and isinstance(func, MethodType):
906-
idx = 0
907907
else:
908-
idx = _dispatchmethod
908+
idx = 0
909+
909910
if isinstance(func, FunctionType) and not hasattr(func, "__wrapped__"):
910911
# Method from inspect._signature_from_function.
911912
func_code = func.__code__

0 commit comments

Comments
 (0)