summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-12-10 10:08:44 -0800
committerEric Wieser <wieser.eric@gmail.com>2017-12-10 17:25:38 -0800
commitb023d734eeec42a2a1064eaed4de12fd676f1de0 (patch)
tree39530c07f73d770c77c00dba45c085b7fb36fd19 /numpy/lib/npyio.py
parent5c16f535e7515c2394b19cc6778ad9b5ae24d729 (diff)
downloadnumpy-b023d734eeec42a2a1064eaed4de12fd676f1de0.tar.gz
DEP: Deprecate the pickle aliases
* The np.ma functions are misleading, as they do not actually do anything special for ma.array * The np.loads functions doesn't even have numpy-specific documentation, and does not behave consistently with `np.load` * The string overloads of np.ma.load and np.ma.dump do not work well on python 3, as they make assumptions about whether a binary or text pickle file is used (gh-5491)
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r--numpy/lib/npyio.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index e4d827334..7b51cb9c7 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -30,7 +30,14 @@ else:
import cPickle as pickle
from future_builtins import map
-loads = pickle.loads
+
+def loads(*args, **kwargs):
+ # NumPy 1.15.0, 2017-12-10
+ warnings.warn(
+ "np.loads is deprecated, use pickle.loads instead",
+ DeprecationWarning, stacklevel=2)
+ return pickle.loads(*args, **kwargs)
+
__all__ = [
'savetxt', 'loadtxt', 'genfromtxt', 'ndfromtxt', 'mafromtxt',