summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libarray.tex
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-03-14 05:43:59 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-03-14 05:43:59 (GMT)
commit49f9bd15ffeef67358a319f89faeaa31ad97d575 (patch)
tree21a7a17750ea5dc4b7042b9f35085933b42d73d5 /Doc/lib/libarray.tex
parent6e2ee866fa5cac9de821921a31ad4ba76dfde8d9 (diff)
downloadcpython-49f9bd15ffeef67358a319f89faeaa31ad97d575.zip
cpython-49f9bd15ffeef67358a319f89faeaa31ad97d575.tar.gz
cpython-49f9bd15ffeef67358a319f89faeaa31ad97d575.tar.bz2
SF feature request #686323: Minor array module enhancements
array.extend() now accepts iterable arguments implements as a series of appends. Besides being a user convenience and matching the behavior for lists, this the saves memory and cycles that would be used to create a temporary array object.
Diffstat (limited to 'Doc/lib/libarray.tex')
-rw-r--r--Doc/lib/libarray.tex11
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/lib/libarray.tex b/Doc/lib/libarray.tex
index 6ec056f..6fd8b0c 100644
--- a/Doc/lib/libarray.tex
+++ b/Doc/lib/libarray.tex
@@ -104,10 +104,13 @@ data from a file written on a machine with a different byte order.
Return the number of occurences of \var{x} in the array.
\end{methoddesc}
-\begin{methoddesc}[array]{extend}{a}
-Append array items from \var{a} to the end of the array. The two
-arrays must have \emph{exactly} the same type code; if not,
-\exception{TypeError} will be raised.
+\begin{methoddesc}[array]{extend}{iterable}
+Append items from \var{iterable} to the end of the array. If
+\var{iterable} is another array, it must have \emph{exactly} the same
+type code; if not, \exception{TypeError} will be raised. If
+\var{iterable} is not an array, it must be iterable and its
+elements must be the right type to be appended to the array.
+\versionchanged[Formerly, the argument could only be another array]{2.4}
\end{methoddesc}
\begin{methoddesc}[array]{fromfile}{f, n}