diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-08-05 01:52:55 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-08-05 01:52:55 +0000 |
commit | 65343e533fbf10a5f93970497065478e24ee6238 (patch) | |
tree | dc0d6510d62983cfb041a4ad257c2973dbf01983 /numpy/oldnumeric/compat.py | |
parent | 9d8e2024ff9014fa2fd9a29812cec615dff6feb9 (diff) | |
download | numpy-65343e533fbf10a5f93970497065478e24ee6238.tar.gz |
Fix-up oldnumeric compatibility layer.
Diffstat (limited to 'numpy/oldnumeric/compat.py')
-rw-r--r-- | numpy/oldnumeric/compat.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/numpy/oldnumeric/compat.py b/numpy/oldnumeric/compat.py index ebc978fee..69941bb09 100644 --- a/numpy/oldnumeric/compat.py +++ b/numpy/oldnumeric/compat.py @@ -5,7 +5,7 @@ __all__ = ['NewAxis', 'LittleEndian', 'sarray', 'arrayrange', 'cross_correlate', 'matrixmultiply', 'outerproduct', 'innerproduct', - 'cross_product', 'array_constructor', + 'cross_product', 'array_constructor', 'pickle_array', 'DumpArray', 'LoadArray', 'multiarray', 'divide_safe', # from cPickle 'dump', 'dumps' @@ -70,4 +70,11 @@ def array_constructor(shape, typecode, thestr, Endian=LittleEndian): else: return x - +def pickle_array(a): + if a.dtype.hasobject: + return (array_constructor, + a.shape, a.dtype.char, a.tolist(), LittleEndian) + else: + return (array_constructor, + (a.shape, a.dtype.char, a.tostring(), LittleEndian)) + |