Reduce a function that is not pickleable via attribute lookup.
(self, func)
| 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. |
no test coverage detected