Mercurial > cpython-lru_cache-weakref
diff Doc/lib/libarray.tex @ 13772:eea51275acbf legacy-trunk
added count, extend, index, pop and remove to arraymodule
| author | Peter Schneider-Kamp <nowonder@nowonder.de> |
|---|---|
| date | Mon, 31 Jul 2000 20:52:21 +0000 |
| parents | e82e82b3b9ad |
| children | bd4cd73cb0d6 |
line wrap: on
line diff
--- a/Doc/lib/libarray.tex Mon Jul 31 20:13:23 2000 +0000 +++ b/Doc/lib/libarray.tex Mon Jul 31 20:52:21 2000 +0000 @@ -83,6 +83,14 @@ 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 @@ 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 @@ 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}
