MCPcopy
hub / github.com/cloudpipe/cloudpickle / _dynamic_function_reduce

Method _dynamic_function_reduce

cloudpickle/cloudpickle.py:1258–1262  ·  view source on GitHub ↗

Reduce a function that is not pickleable via attribute lookup.

(self, func)

Source from the content-addressed store, hash-verified

1256 # function reducers are defined as instance methods of cloudpickle.Pickler
1257 # objects, as they rely on a cloudpickle.Pickler attribute (globals_ref)
1258 def _dynamic_function_reduce(self, func):
1259 """Reduce a function that is not pickleable via attribute lookup."""
1260 newargs = self._function_getnewargs(func)
1261 state = _function_getstate(func)
1262 return (_make_function, newargs, state, None, None, _function_setstate)
1263
1264 def _function_reduce(self, obj):
1265 """Reducer for function objects.

Callers 2

_function_reduceMethod · 0.95
save_functionMethod · 0.95

Calls 2

_function_getnewargsMethod · 0.95
_function_getstateFunction · 0.85

Tested by

no test coverage detected