Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #4
0
 def get_globals_for_reduction(self):
     # This will recursively get the globals used by any nested
     # implementation function.
     return serialize._get_function_globals_for_reduction(self.py_func)
Beispiel #5
0
 def get_globals_for_reduction(self):
     return serialize._get_function_globals_for_reduction(self.py_func)
Beispiel #6
0
 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)
     )