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

Function _get_method

Lib/unittest/mock.py:2063–2068  ·  view source on GitHub ↗

Turns a callable object (like a mock) into a real function

(name, func)

Source from the content-addressed store, hash-verified

2061
2062
2063def _get_method(name, func):
2064 "Turns a callable object (like a mock) into a real function"
2065 def method(self, /, *args, **kw):
2066 return func(self, *args, **kw)
2067 method.__name__ = name
2068 return method
2069
2070
2071_magics = {

Callers 1

__setattr__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…