MCPcopy Index your code
hub / github.com/python/cpython / __call__

Method __call__

Lib/functools.py:380–393  ·  view source on GitHub ↗
(self, /, *args, **keywords)

Source from the content-addressed store, hash-verified

378 __repr__ = recursive_repr()(_partial_repr)
379
380 def __call__(self, /, *args, **keywords):
381 phcount = self._phcount
382 if phcount:
383 try:
384 pto_args = self._merger(self.args + args)
385 args = args[phcount:]
386 except IndexError:
387 raise TypeError("missing positional arguments "
388 "in 'partial' call; expected "
389 f"at least {phcount}, got {len(args)}")
390 else:
391 pto_args = self.args
392 keywords = {**self.keywords, **keywords}
393 return self.func(*pto_args, *args, **keywords)
394
395 def __get__(self, obj, objtype=None):
396 if obj is None:

Callers

nothing calls this directly

Calls 1

funcMethod · 0.45

Tested by

no test coverage detected