summaryrefslogtreecommitdiff
path: root/doc/numpybook/numpybook.lyx
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 /doc/numpybook/numpybook.lyx
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 'doc/numpybook/numpybook.lyx')
-rw-r--r--doc/numpybook/numpybook.lyx12
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/numpybook/numpybook.lyx b/doc/numpybook/numpybook.lyx
index 59f51b4eb..65185a2be 100644
--- a/doc/numpybook/numpybook.lyx
+++ b/doc/numpybook/numpybook.lyx
@@ -6062,9 +6062,9 @@ name "ndarray!methods!itemset"
\end_layout
\begin_layout Description
-tostring
+tobytes
\begin_inset LatexCommand index
-name "ndarray!methods!tostring"
+name "ndarray!methods!tobytes"
\end_inset
@@ -6134,7 +6134,7 @@ format
the shape, type, or endianness of an array.
When written in binary mode, tofile is functionally equivalent to
\family typewriter
-fid.write(self.tostring())
+fid.write(self.tobytes())
\family default
.
\end_layout
@@ -6836,7 +6836,7 @@ Insert scalar (last argument) into array
\begin_layout Standard
\series bold
-tostring
+tobytes
\end_layout
\end_inset
@@ -9450,7 +9450,7 @@ name "ndarray!special methods!setstate"
).
In this tuple, isfortran is a Bool stating whether the following flattened
data is in Fortran order or not, and string_or_list is a string formed
- by self.tostring() if the data type is not object.
+ by self.tobytes() if the data type is not object.
If the data type of self is an object array, then string_or_list is a flat
list equivalent to self.ravel().tolist().
@@ -17719,7 +17719,7 @@ __reduce__ ()
\InsetSpace ~
This is called to pickle an array scalar.
It returns a tuple of (numpy.core.multiarray.scalar, self.dtypestr, obj or
- self.tostring()) which can be used to reconstruct the scalar on unpickling.
+ self.tobytes()) which can be used to reconstruct the scalar on unpickling.
Notice that no state is written, because the entire scalar can be constructed
from just the string.
Also, if this is an object array scalar, then the Python object being reference