Mercurial > cpython-lru_cache-weakref
diff Doc/lib/libarray.tex @ 31660:35f56e08727f legacy-trunk
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.
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Sun, 14 Mar 2004 05:43:59 +0000 |
| parents | 2bb5ceef9ac3 |
| children | 0b181bf230c9 |
line wrap: on
line diff
--- a/Doc/lib/libarray.tex Sun Mar 14 04:37:50 2004 +0000 +++ b/Doc/lib/libarray.tex Sun Mar 14 05:43:59 2004 +0000 @@ -104,10 +104,13 @@ 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}
