[Patches] array documentation
Peter Schneider-Kamp
peter@schneider-kamp.de
Mon, 22 May 2000 07:41:58 +0200
This is a multi-part message in MIME format.
--------------58ACFFD6BE151890F745B923
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Problem:
Forgot to update libarray.tex and libstdtypes.tex to
reflect new count,index,pop and remove methods.
Solution:
patch attached as plaintext context diff
--
I confirm that, to the best of my knowledge and belief, this
contribution is free of any claims of third parties under
copyright, patent or other rights or interests ("claims"). To
the extent that I have any such claims, I hereby grant to CNRI a
nonexclusive, irrevocable, royalty-free, worldwide license to
reproduce, distribute, perform and/or display publicly, prepare
derivative versions, and otherwise use this contribution as part
of the Python software and its related documentation, or any
derivative versions thereof, at no cost to CNRI or its licensed
users, and to authorize others to do so.
I acknowledge that CNRI may, at its sole discretion, decide
whether or not to incorporate this contribution in the Python
software and its related documentation. I further grant CNRI
permission to use my name and other identifying information
provided to CNRI by me for use in connection with the Python
software and its related documentation.
--
Peter Schneider-Kamp ++47-7388-7331
Herman Krags veg 51-11 mailto:peter@schneider-kamp.de
N-7050 Trondheim http://schneider-kamp.de
--------------58ACFFD6BE151890F745B923
Content-Type: text/plain; charset=us-ascii;
name="array.doc.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="array.doc.patch"
diff -c --recursive python/dist/src/Doc/lib/libarray.tex python-mod/dist/src/Doc/lib/libarray.tex
*** python/dist/src/Doc/lib/libarray.tex Mon Apr 3 22:13:52 2000
--- python-mod/dist/src/Doc/lib/libarray.tex Mon May 22 07:21:12 2000
***************
*** 83,88 ****
--- 83,92 ----
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]{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,114 ****
--- 108,129 ----
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.}
***************
*** 118,123 ****
--- 133,142 ----
available are still inserted into the array. \var{f} must be a real
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}{}
diff -c --recursive python/dist/src/Doc/lib/libstdtypes.tex python-mod/dist/src/Doc/lib/libstdtypes.tex
*** python/dist/src/Doc/lib/libstdtypes.tex Mon Apr 3 22:13:54 2000
--- python-mod/dist/src/Doc/lib/libstdtypes.tex Mon May 22 07:16:52 2000
***************
*** 506,513 ****
\item[(3)] Raises \exception{ValueError} when \var{x} is not found in
\var{s}.
! \item[(4)] The \method{pop()} method is experimental and not supported
! by other mutable sequence types than lists. The optional argument
\var{i} defaults to \code{-1}, so that by default the last item is
removed and returned.
--- 506,513 ----
\item[(3)] Raises \exception{ValueError} when \var{x} is not found in
\var{s}.
! \item[(4)] The \method{pop()} method is experimental and at the moment
! only supported by the list and array types. The optional argument
\var{i} defaults to \code{-1}, so that by default the last item is
removed and returned.
--------------58ACFFD6BE151890F745B923--