summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2014-02-03 20:01:07 +0100
committerJulian Taylor <jtaylor.debian@googlemail.com>2014-02-11 19:30:21 +0100
commit2facd5cbdcaa08b61270c0c0760a39cd03acc007 (patch)
tree7001911b928ecc830184633e209bd052073d6895 /numpy/lib/format.py
parentb7850701a31127cad8c7399cea6be9cd5f71bec5 (diff)
downloadnumpy-2facd5cbdcaa08b61270c0c0760a39cd03acc007.tar.gz
ENH: add tobytes and stop using tostring in documentation
tostring returns bytes which are not equal to string, so provide a tobytes function alias. tostring does not emit a deprecation warning yet so rdepends do not need to check two names to support older versions of numpy without warnings.
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r--numpy/lib/format.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 4cfbbe05d..631e92959 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -407,7 +407,7 @@ def write_array(fp, array, version=(1, 0)):
for chunk in numpy.nditer(
array, flags=['external_loop', 'buffered', 'zerosize_ok'],
buffersize=buffersize, order='F'):
- fp.write(chunk.tostring('C'))
+ fp.write(chunk.tobytes('C'))
else:
if isfileobj(fp):
array.tofile(fp)
@@ -415,7 +415,7 @@ def write_array(fp, array, version=(1, 0)):
for chunk in numpy.nditer(
array, flags=['external_loop', 'buffered', 'zerosize_ok'],
buffersize=buffersize, order='C'):
- fp.write(chunk.tostring('C'))
+ fp.write(chunk.tobytes('C'))
def read_array(fp):