summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r--numpy/ma/core.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index e24cb956c..1ab24b228 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5954,10 +5954,17 @@ class MaskedArray(ndarray):
return result.tolist()
def tostring(self, fill_value=None, order='C'):
+ r"""
+ A compatibility alias for `tobytes`, with exactly the same behavior.
+
+ Despite its name, it returns `bytes` not `str`\ s.
+
+ .. deprecated:: 1.19.0
"""
- This function is a compatibility alias for tobytes. Despite its name it
- returns bytes not strings.
- """
+ # 2020-03-30, Numpy 1.19.0
+ warnings.warn(
+ "tostring() is deprecated. Use tobytes() instead.",
+ DeprecationWarning, stacklevel=2)
return self.tobytes(fill_value, order=order)