예제 #1
0
 def __init__(self, writer, reducers=None, protocol=HIGHEST_PROTOCOL):
     Pickler.__init__(self, writer, protocol=protocol)
     if reducers is None:
         reducers = {}
     # Make the dispatch registry an instance level attribute instead of
     # a reference to the class dictionary under Python 2
     self.dispatch = Pickler.dispatch.copy()
     for type, reduce_func in reducers.items():
         self.register(type, reduce_func)
예제 #2
0
파일: pool.py 프로젝트: crobinsonut/joblib
 def __init__(self, writer, reducers=None, protocol=HIGHEST_PROTOCOL):
     Pickler.__init__(self, writer, protocol=protocol)
     if reducers is None:
         reducers = {}
     if hasattr(Pickler, 'dispatch'):
         # Make the dispatch registry an instance level attribute instead of
         # a reference to the class dictionary under Python 2
         self.dispatch = Pickler.dispatch.copy()
     else:
         # Under Python 3 initialize the dispatch table with a copy of the
         # default registry
         self.dispatch_table = copyreg.dispatch_table.copy()
     for type, reduce_func in reducers.items():
         self.register(type, reduce_func)
예제 #3
0
 def __init__(self, writer, reducers=None, protocol=HIGHEST_PROTOCOL):
     Pickler.__init__(self, writer, protocol=protocol)
     if reducers is None:
         reducers = {}
     if hasattr(Pickler, 'dispatch'):
         # Make the dispatch registry an instance level attribute instead of
         # a reference to the class dictionary under Python 2
         self.dispatch = Pickler.dispatch.copy()
     else:
         # Under Python 3 initialize the dispatch table with a copy of the
         # default registry
         self.dispatch_table = copyreg.dispatch_table.copy()
     for type, reduce_func in reducers.items():
         self.register(type, reduce_func)
예제 #4
0
 def __init__(self, *args, **kwds):
     Pickler.__init__(self, *args, **kwds)
예제 #5
0
 def __init__(self, *args):
     Pickler.__init__(self, *args)
     self.dispatch_table = dispatch_table.copy()
     self.dispatch_table.update(self._extra_reducers)