summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libsets.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2003-01-06 15:50:32 (GMT)
committerFred Drake <fdrake@acm.org>2003-01-06 15:50:32 (GMT)
commit2e3ae210605bc2a9caa6014bd170318e84a7d465 (patch)
tree8233358c1853a9532d30da5bbd318470a1fac9f5 /Doc/lib/libsets.tex
parent11ae4e20e02c63fc63494728f1c162611b2d0328 (diff)
downloadcpython-2e3ae210605bc2a9caa6014bd170318e84a7d465.zip
cpython-2e3ae210605bc2a9caa6014bd170318e84a7d465.tar.gz
cpython-2e3ae210605bc2a9caa6014bd170318e84a7d465.tar.bz2
Fix some nits Guido brought up last August:
- give subsection pages nicer names - shorten some really long table cells; table cells can't wrap in the typeset version of the documentation
Diffstat (limited to 'Doc/lib/libsets.tex')
-rw-r--r--Doc/lib/libsets.tex18
1 files changed, 8 insertions, 10 deletions
diff --git a/Doc/lib/libsets.tex b/Doc/lib/libsets.tex
index c5239a4..046463e 100644
--- a/Doc/lib/libsets.tex
+++ b/Doc/lib/libsets.tex
@@ -60,7 +60,7 @@ elements must be known when the constructor is called.
\end{classdesc}
-\subsection{Set Objects}
+\subsection{Set Objects \label{set-objects}}
Instances of \class{Set} and \class{ImmutableSet} both provide
the following operations:
@@ -142,23 +142,21 @@ but not found in \class{ImmutableSet}:
\hline
\lineii{\var{s}.add(\var{x})}
- {Add element \var{x} to set \var{s}}
+ {add element \var{x} to set \var{s}}
\lineii{\var{s}.remove(\var{x})}
- {Remove element \var{x} from set \var{s}}
+ {remove \var{x} from set \var{s}}
\lineii{\var{s}.discard(\var{x})}
- {Removes element \var{x} from set \var{s}. Like \var{s}.remove(\var{x})
- but does not raise KeyError if \var{x} is not in \var{s}}
+ {removes \var{x} from set \var{s} if present}
\lineii{\var{s}.pop()}
- {Remove and return an element from \var{s}; no guarantee is
- made about which element is removed}
+ {remove and return an arbitrary element from \var{s}}
\lineii{\var{s}.update(\var{t})}
- {Add elements from \var{t} to set \var{s}}
+ {add elements from \var{t} to set \var{s}}
\lineii{\var{s}.clear()}
- {Remove all elements from set \var{s}}
+ {remove all elements from set \var{s}}
\end{tableii}
-\subsection{Example}
+\subsection{Example \label{set-example}}
\begin{verbatim}
>>> from sets import Set