Skip to content

Commit

Permalink
move numpy special register to save
Browse files Browse the repository at this point in the history
  • Loading branch information
mmckerns committed Aug 11, 2022
1 parent 1d3e8cf commit bf0f4fa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dill/_dill.py
Expand Up @@ -367,7 +367,7 @@ def __init__(self, file, *args, **kwds):
self._postproc = OrderedDict()
self._file = file

def dump(self, obj): #NOTE: if settings change, need to update attributes
def save(self, obj, save_persistent_id=True):
# register if the object is a numpy ufunc
# thanks to Paul Kienzle for pointing out ufuncs didn't pickle
if NumpyUfuncType and numpyufunc(obj):
Expand Down Expand Up @@ -410,6 +410,11 @@ def save_numpy_array(pickler, obj):
if GENERATOR_FAIL and type(obj) == GeneratorType:
msg = "Can't pickle %s: attribute lookup builtins.generator failed" % GeneratorType
raise PicklingError(msg)
StockPickler.save(self, obj, save_persistent_id)

save.__doc__ = StockPickler.save.__doc__

def dump(self, obj): #NOTE: if settings change, need to update attributes
logger.trace_setup(self)
StockPickler.dump(self, obj)

Expand Down

0 comments on commit bf0f4fa

Please sign in to comment.