MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / _dynamic_function_reduce

Method _dynamic_function_reduce

cloudpickle/cloudpickle.py:1272–1276  ·  view source on GitHub ↗

Reduce a function that is not pickleable via attribute lookup.

(self, func)

Source from the content-addressed store, hash-verified

1270 # function reducers are defined as instance methods of cloudpickle.Pickler
1271 # objects, as they rely on a cloudpickle.Pickler attribute (globals_ref)
1272 def _dynamic_function_reduce(self, func):
1273 """Reduce a function that is not pickleable via attribute lookup."""
1274 newargs = self._function_getnewargs(func)
1275 state = _function_getstate(func)
1276 return (_make_function, newargs, state, None, None, _function_setstate)
1277
1278 def _function_reduce(self, obj):
1279 """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