Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cut first argument after the fact!
  • Loading branch information
johnslavik committed Feb 9, 2026
commit d05750f5d7ba8f3b54e7d17ab95b5504f0565dca
9 changes: 6 additions & 3 deletions Lib/functools.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# import weakref # Deferred to single_dispatch()
from operator import itemgetter
from reprlib import recursive_repr
from types import FunctionType, GenericAlias, MethodType, MappingProxyType, UnionType
from types import GenericAlias, MethodType, MappingProxyType, UnionType
from _thread import RLock

################################################################################
Expand Down Expand Up @@ -1096,12 +1096,15 @@ def __call__(self, /, *args, **kwargs):
'1 positional argument')
if self._skip_bound_arg:
method = self._dispatch(args[1].__class__)
if isinstance(method, FunctionType):
args = args[1:]
else:
method = self._dispatch(args[0].__class__)
if hasattr(method, "__get__"):
method = method.__get__(self._obj, self._cls)
if (
self._skip_bound_arg
and isinstance(method, MethodType)
and method.__self__ is self):
args = args[1:]
return method(*args, **kwargs)

def __getattr__(self, name):
Expand Down
Loading