summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libarray.tex
diff options
context:
space:
mode:
authorPeter Schneider-Kamp <nowonder@nowonder.de>2000-07-31 20:52:21 (GMT)
committerPeter Schneider-Kamp <nowonder@nowonder.de>2000-07-31 20:52:21 (GMT)
commit5a65c2d43607a5033d7171445848cde21f07d81d (patch)
treed8dad896da0f678879cdf5b62ad38e01ccb85430 /Doc/lib/libarray.tex
parent4640e13259d50b754c1e0ea39b05559b3cd18cc3 (diff)
downloadcpython-5a65c2d43607a5033d7171445848cde21f07d81d.zip
cpython-5a65c2d43607a5033d7171445848cde21f07d81d.tar.gz
cpython-5a65c2d43607a5033d7171445848cde21f07d81d.tar.bz2
added count, extend, index, pop and remove to arraymodule
Diffstat (limited to 'Doc/lib/libarray.tex')
-rw-r--r--Doc/lib/libarray.tex23
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/lib/libarray.tex b/Doc/lib/libarray.tex
index 0e1a411..7be96aa 100644
--- a/Doc/lib/libarray.tex
+++ b/Doc/lib/libarray.tex
@@ -83,6 +83,14 @@ values, \exception{RuntimeError} is raised. It is useful when reading
data from a file written on a machine with a different byte order.
\end{methoddesc}
+\begin{methoddesc}[array]{count}{x}
+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.
+\end{methoddesc}
+
\begin{methoddesc}[array]{fromfile}{f, n}
Read \var{n} items (as machine values) from the file object \var{f}
and append them to the end of the array. If less than \var{n} items
@@ -104,11 +112,22 @@ array of machine values (i.e. as if it had been read from a
file using the \method{fromfile()} method).
\end{methoddesc}
+\begin{methoddesc}[array]{index}{x}
+Return the smallest \var{i} such that \var{i} is the index of
+the first occurence of \var{x} in the array.
+\end{methoddesc}
+
\begin{methoddesc}[array]{insert}{i, x}
Insert a new item with value \var{x} in the array before position
\var{i}.
\end{methoddesc}
+\begin{methoddesc}[array]{pop}{\optional{i}}
+Removes the item with the index \var{i} from the array and returns
+it. The optional argument defaults to \code{-1}, so that by default
+the last item is removed and returned.
+\end{methoddesc}
+
\begin{methoddesc}[array]{read}{f, n}
\deprecated {1.5.1}
{Use the \method{fromfile()} method.}
@@ -120,6 +139,10 @@ built-in file object; something else with a \method{read()} method won't
do.
\end{methoddesc}
+\begin{methoddesc}[array]{remove}{x}
+Remove the first occurence of \var{x} from the array.
+\end{methoddesc}
+
\begin{methoddesc}[array]{reverse}{}
Reverse the order of the items in the array.
\end{methoddesc}