Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 472b9a3

Browse files
committed
Clearly I was to quick with the previous commit...
Need to add \optional{} to sort argument too. Made x a \var in descr of pop. Fixed note for pop() and mentioned that it is experimental. Also added pop to index.
1 parent 97ea116 commit 472b9a3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Doc/lib/libtypes.tex

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,12 @@ \subsubsection{Mutable Sequence Types}
467467
{same as \code{\var{s}[\var{i}:\var{i}] = [\var{x}]}
468468
if \code{\var{i} >= 0}}{}
469469
\lineiii{\var{s}.pop(\optional{\var{i}})}
470-
{same as \code{x = \var{s}[\var{i}]; del \var{s}[\var{i}]; return x}}{(4)}
470+
{same as \code{\var{x} = \var{s}[\var{i}]; del \var{s}[\var{i}]; return \var{x}}}{(4)}
471471
\lineiii{\var{s}.remove(\var{x})}
472472
{same as \code{del \var{s}[\var{s}.index(\var{x})]}}{(1)}
473473
\lineiii{\var{s}.reverse()}
474474
{reverses the items of \var{s} in place}{(3)}
475-
\lineiii{\var{s}.sort(\var{cmpfunc})}
475+
\lineiii{\var{s}.sort(\optional{\var{cmpfunc}})}
476476
{sort the items of \var{s} in place}{(2), (3)}
477477
\end{tableiii}
478478
\indexiv{operations on}{mutable}{sequence}{types}
@@ -486,6 +486,7 @@ \subsubsection{Mutable Sequence Types}
486486
\ttindex{count}
487487
\ttindex{index}
488488
\ttindex{insert}
489+
\ttindex{pop}
489490
\ttindex{remove}
490491
\ttindex{reverse}
491492
\ttindex{sort}
@@ -510,7 +511,9 @@ \subsubsection{Mutable Sequence Types}
510511
list. They don't return the sorted or reversed list to remind you of
511512
this side effect.
512513

513-
\item[(4)4] The optional argument \var{i} defaults to \code{-1}, so that
514+
\item[(4)] The \method{pop()} method is experimental and not supported
515+
by other mutable sequence types than lists.
516+
The optional argument \var{i} defaults to \code{-1}, so that
514517
by default the last item is removed and returned.
515518

516519
\end{description}

0 commit comments

Comments
 (0)