def __reduce__(self): """ Reduce the instance for serialization. Compiled definitions are discarded. """ glbls = serialize._get_function_globals_for_reduction(self.py_func) func_reduced = serialize._reduce_function(self.py_func, glbls) config = self._serialize_config() args = (self.__class__, func_reduced, self.bind, self.targetoptions, config) return (serialize._rebuild_reduction, args)
def __reduce__(self): globs = serialize._get_function_globals_for_reduction(self.py_func) return ( serialize._rebuild_reduction, ( self.__class__, serialize._reduce_function(self.py_func, globs), self.locals, self.targetoptions, ), )
def __reduce__(self): globs = serialize._get_function_globals_for_reduction(self.py_func) func_reduced = serialize._reduce_function(self.py_func, globs) args = ( self.__class__, func_reduced, self.return_type, self.args, self.inline, self.debug, ) return (serialize._rebuild_reduction, args)
def __reduce__(self): """ Reduce the instance for pickling. This will serialize the original function as well the compilation options and compiled signatures, but not the compiled code itself. """ if self._can_compile: sigs = [] else: sigs = [cr.signature for cr in self.overloads.values()] globs = self._compiler.get_globals_for_reduction() return (serialize._rebuild_reduction, (self.__class__, str(self._uuid), serialize._reduce_function(self.py_func, globs), self.locals, self.targetoptions, self._impl_kind, self._can_compile, sigs))
def reduce_func(fn): gs = serialize._get_function_globals_for_reduction(fn) return serialize._reduce_function(fn, gs)
def __reduce__(self): globs = _serialize._get_function_globals_for_reduction(self.__func) return ( self._rebuild, _serialize._reduce_function(self.__func, globs) )