In note mentioning [].remove()'s exception, tell what exception is
raised. Prompted by Barry's whining. ;-0
This commit is contained in:
parent
09be409220
commit
68921dfa31
|
@ -478,43 +478,39 @@ The following operations are defined on mutable sequence types (where
|
||||||
\indexii{slice}{assignment}
|
\indexii{slice}{assignment}
|
||||||
\stindex{del}
|
\stindex{del}
|
||||||
\withsubitem{(list method)}{
|
\withsubitem{(list method)}{
|
||||||
\ttindex{append()}
|
\ttindex{append()}\ttindex{extend()}\ttindex{count()}\ttindex{index()}
|
||||||
\ttindex{extend()}
|
\ttindex{insert()}\ttindex{pop()}\ttindex{remove()}\ttindex{reverse()}
|
||||||
\ttindex{count()}
|
|
||||||
\ttindex{index()}
|
|
||||||
\ttindex{insert()}
|
|
||||||
\ttindex{pop()}
|
|
||||||
\ttindex{remove()}
|
|
||||||
\ttindex{reverse()}
|
|
||||||
\ttindex{sort()}}
|
\ttindex{sort()}}
|
||||||
\noindent
|
\noindent
|
||||||
Notes:
|
Notes:
|
||||||
\begin{description}
|
\begin{description}
|
||||||
\item[(1)] Raises an exception when \var{x} is not found in \var{s}.
|
\item[(1)] Raises \exception{ValueError} when \var{x} is not found in
|
||||||
|
\var{s}.
|
||||||
|
|
||||||
\item[(2)] The \method{sort()} method takes an optional argument
|
\item[(2)] The \method{sort()} method takes an optional argument
|
||||||
specifying a comparison function of two arguments (list items) which
|
specifying a comparison function of two arguments (list items) which
|
||||||
should return \code{-1}, \code{0} or \code{1} depending on whether the
|
should return \code{-1}, \code{0} or \code{1} depending on whether
|
||||||
first argument is considered smaller than, equal to, or larger than the
|
the first argument is considered smaller than, equal to, or larger
|
||||||
second argument. Note that this slows the sorting process down
|
than the second argument. Note that this slows the sorting process
|
||||||
considerably; e.g. to sort a list in reverse order it is much faster
|
down considerably; e.g. to sort a list in reverse order it is much
|
||||||
to use calls to the methods \method{sort()} and \method{reverse()}
|
faster to use calls to the methods \method{sort()} and
|
||||||
than to use the built-in function \function{sort()} with a
|
\method{reverse()} than to use the built-in function
|
||||||
comparison function that reverses the ordering of the elements.
|
\function{sort()} with a comparison function that reverses the
|
||||||
|
ordering of the elements.
|
||||||
|
|
||||||
\item[(3)] The \method{sort()} and \method{reverse()} methods modify the
|
\item[(3)] The \method{sort()} and \method{reverse()} methods modify the
|
||||||
list in place for economy of space when sorting or reversing a large
|
list in place for economy of space when sorting or reversing a large
|
||||||
list. They don't return the sorted or reversed list to remind you of
|
list. They don't return the sorted or reversed list to remind you
|
||||||
this side effect.
|
of this side effect.
|
||||||
|
|
||||||
\item[(4)] The \method{pop()} method is experimental and not supported
|
\item[(4)] The \method{pop()} method is experimental and not supported
|
||||||
by other mutable sequence types than lists.
|
by other mutable sequence types than lists. The optional argument
|
||||||
The optional argument \var{i} defaults to \code{-1}, so that
|
\var{i} defaults to \code{-1}, so that by default the last item is
|
||||||
by default the last item is removed and returned.
|
removed and returned.
|
||||||
|
|
||||||
\item[(5)] Raises an exception when \var{x} is not a list object. The
|
\item[(5)] Raises an exception when \var{x} is not a list object. The
|
||||||
\method{extend()} method is experimental and not supported by mutable types
|
\method{extend()} method is experimental and not supported by
|
||||||
other than lists.
|
mutable types other than lists.
|
||||||
\end{description}
|
\end{description}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue