MCPcopy Index your code
hub / github.com/RustPython/RustPython / _copy_func_details

Function _copy_func_details

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

Source from the content-addressed store, hash-verified

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

Callers 3

_check_signatureFunction · 0.85
_set_signatureFunction · 0.85
_set_async_signatureFunction · 0.85

Calls 2

setattrFunction · 0.85
getattrFunction · 0.85

Tested by

no test coverage detected