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

Function _copy_func_details

Lib/unittest/mock.py:141–151  ·  view source on GitHub ↗
(func, funcopy)

Source from the content-addressed store, hash-verified

139
140
141def _copy_func_details(func, funcopy):
142 # we explicitly don't copy func.__dict__ into this copy as it would
143 # expose original attributes that should be mocked
144 for attribute in (
145 '__name__', '__doc__', '__text_signature__',
146 '__module__', '__defaults__', '__kwdefaults__',
147 ):
148 try:
149 setattr(funcopy, attribute, getattr(func, attribute))
150 except AttributeError:
151 pass
152
153
154def _callable(obj):

Callers 3

_check_signatureFunction · 0.85
_set_signatureFunction · 0.85
_set_async_signatureFunction · 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…