Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/liboperator.tex @ 28646:193b8aec00ce legacy-trunk
Changes from Jonathan Riehl to allow his pgen extension (PEP 269) to
work. This includes some more code that used to be part of pgen in
the main parser; I'm okay with that. I'll see if the Windows build
needs work next.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Apr 2003 14:55:42 +0000 |
| parents | 16b25032217f |
| children | fef6fdec5292 |
| rev | line source |
|---|---|
| 8918 | 1 \section{\module{operator} --- |
| 2 Standard operators as functions.} | |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8418
diff
changeset
|
3 \declaremodule{builtin}{operator} |
| 8918 | 4 \sectionauthor{Skip Montanaro}{skip@automatrix.com} |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8418
diff
changeset
|
5 |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8418
diff
changeset
|
6 \modulesynopsis{All Python's standard operators as built-in functions.} |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8418
diff
changeset
|
7 |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 |
| 7603 | 9 The \module{operator} module exports a set of functions implemented in C |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 corresponding to the intrinsic operators of Python. For example, |
|
6955
38493b9376ea
Remove unneeded "{}" that confused makeinfo.
Fred Drake <fdrake@acm.org>
parents:
6876
diff
changeset
|
11 \code{operator.add(x, y)} is equivalent to the expression \code{x+y}. The |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 function names are those used for special class methods; variants without |
| 6745 | 13 leading and trailing \samp{__} are also provided for convenience. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
15 The functions fall into categories that perform object comparisons, |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
16 logical operations, mathematical operations, sequence operations, and |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
17 abstract type tests. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
18 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
19 The object comparison functions are useful for all objects, and are |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
20 named after the rich comparison operators they support: |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
21 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
22 \begin{funcdesc}{lt}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
23 \funcline{le}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
24 \funcline{eq}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
25 \funcline{ne}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
26 \funcline{ge}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
27 \funcline{gt}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
28 \funcline{__lt__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
29 \funcline{__le__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
30 \funcline{__eq__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
31 \funcline{__ne__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
32 \funcline{__ge__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
33 \funcline{__gt__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
34 Perform ``rich comparisons'' between \var{a} and \var{b}. Specifically, |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
35 \code{lt(\var{a}, \var{b})} is equivalent to \code{\var{a} < \var{b}}, |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
36 \code{le(\var{a}, \var{b})} is equivalent to \code{\var{a} <= \var{b}}, |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
37 \code{eq(\var{a}, \var{b})} is equivalent to \code{\var{a} == \var{b}}, |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
38 \code{ne(\var{a}, \var{b})} is equivalent to \code{\var{a} != \var{b}}, |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
39 \code{gt(\var{a}, \var{b})} is equivalent to \code{\var{a} > \var{b}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
40 and |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
41 \code{ge(\var{a}, \var{b})} is equivalent to \code{\var{a} >= \var{b}}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
42 Note that unlike the built-in \function{cmp()}, these functions can |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
43 return any value, which may or may not be interpretable as a Boolean |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
44 value. See the \citetitle[../ref/ref.html]{Python Reference Manual} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
45 for more informations about rich comparisons. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
46 \versionadded{2.2} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
47 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
48 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
49 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
50 The logical operations are also generally applicable to all objects, |
|
28003
16b25032217f
Fill in missing table entries.
Raymond Hettinger <python@rcn.com>
parents:
27290
diff
changeset
|
51 and support truth tests, identity tests, and boolean operations: |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
52 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
53 \begin{funcdesc}{not_}{o} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
54 \funcline{__not__}{o} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
55 Return the outcome of \keyword{not} \var{o}. (Note that there is no |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
56 \method{__not__()} method for object instances; only the interpreter |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
57 core defines this operation. The result is affected by the |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
58 \method{__nonzero__()} and \method{__len__()} methods.) |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
59 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
60 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
61 \begin{funcdesc}{truth}{o} |
|
27219
2ed518ab2fd2
Minor correction and clarification.
Fred Drake <fdrake@acm.org>
parents:
24904
diff
changeset
|
62 Return \constant{True} if \var{o} is true, and \constant{False} |
|
27223
201cdeb305f6
Try to make a sentance more readable.
Neal Norwitz <nnorwitz@gmail.com>
parents:
27219
diff
changeset
|
63 otherwise. This is equivalent to using the \class{bool} |
|
27219
2ed518ab2fd2
Minor correction and clarification.
Fred Drake <fdrake@acm.org>
parents:
24904
diff
changeset
|
64 constructor. |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
65 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
66 |
|
27290
e83a42a90df1
SF patch #670423: Add missing identity tests to operator.c
Raymond Hettinger <python@rcn.com>
parents:
27223
diff
changeset
|
67 \begin{funcdesc}{is_}{a, b} |
|
e83a42a90df1
SF patch #670423: Add missing identity tests to operator.c
Raymond Hettinger <python@rcn.com>
parents:
27223
diff
changeset
|
68 Return \code{\var{a} is \var{b}}. Tests object identity. |
|
e83a42a90df1
SF patch #670423: Add missing identity tests to operator.c
Raymond Hettinger <python@rcn.com>
parents:
27223
diff
changeset
|
69 \end{funcdesc} |
|
e83a42a90df1
SF patch #670423: Add missing identity tests to operator.c
Raymond Hettinger <python@rcn.com>
parents:
27223
diff
changeset
|
70 |
|
e83a42a90df1
SF patch #670423: Add missing identity tests to operator.c
Raymond Hettinger <python@rcn.com>
parents:
27223
diff
changeset
|
71 \begin{funcdesc}{is_not}{a, b} |
|
e83a42a90df1
SF patch #670423: Add missing identity tests to operator.c
Raymond Hettinger <python@rcn.com>
parents:
27223
diff
changeset
|
72 Return \code{\var{a} is not \var{b}}. Tests object identity. |
|
e83a42a90df1
SF patch #670423: Add missing identity tests to operator.c
Raymond Hettinger <python@rcn.com>
parents:
27223
diff
changeset
|
73 \end{funcdesc} |
|
e83a42a90df1
SF patch #670423: Add missing identity tests to operator.c
Raymond Hettinger <python@rcn.com>
parents:
27223
diff
changeset
|
74 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
75 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
76 The mathematical and bitwise operations are the most numerous: |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
77 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
78 \begin{funcdesc}{abs}{o} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
79 \funcline{__abs__}{o} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
80 Return the absolute value of \var{o}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
81 \end{funcdesc} |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
82 |
| 6745 | 83 \begin{funcdesc}{add}{a, b} |
| 7603 | 84 \funcline{__add__}{a, b} |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
85 Return \var{a} \code{+} \var{b}, for \var{a} and \var{b} numbers. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
86 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
87 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
88 \begin{funcdesc}{and_}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
89 \funcline{__and__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
90 Return the bitwise and of \var{a} and \var{b}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
91 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
92 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
93 \begin{funcdesc}{div}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
94 \funcline{__div__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
95 Return \var{a} \code{/} \var{b} when \code{__future__.division} is not |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
96 in effect. This is also known as ``classic'' division. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
97 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
98 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
99 \begin{funcdesc}{floordiv}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
100 \funcline{__floordiv__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
101 Return \var{a} \code{//} \var{b}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
102 \versionadded{2.2} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
103 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
104 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
105 \begin{funcdesc}{inv}{o} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
106 \funcline{invert}{o} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
107 \funcline{__inv__}{o} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
108 \funcline{__invert__}{o} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
109 Return the bitwise inverse of the number \var{o}. This is equivalent |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
110 to \code{\textasciitilde}\var{o}. The names \function{invert()} and |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
111 \function{__invert__()} were added in Python 2.0. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
112 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
113 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
114 \begin{funcdesc}{lshift}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
115 \funcline{__lshift__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
116 Return \var{a} shifted left by \var{b}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
117 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
118 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
119 \begin{funcdesc}{mod}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
120 \funcline{__mod__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
121 Return \var{a} \code{\%} \var{b}. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
122 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
123 |
| 6745 | 124 \begin{funcdesc}{mul}{a, b} |
| 7603 | 125 \funcline{__mul__}{a, b} |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
126 Return \var{a} \code{*} \var{b}, for \var{a} and \var{b} numbers. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
127 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
128 |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
129 \begin{funcdesc}{neg}{o} |
| 7603 | 130 \funcline{__neg__}{o} |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
131 Return \var{o} negated. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
132 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
133 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
134 \begin{funcdesc}{or_}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
135 \funcline{__or__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
136 Return the bitwise or of \var{a} and \var{b}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
137 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
138 |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
139 \begin{funcdesc}{pos}{o} |
| 7603 | 140 \funcline{__pos__}{o} |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
141 Return \var{o} positive. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
142 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
143 |
|
24887
d797cfa8ca0d
Added __pow__(a,b) to the operator module. Completes the pattern of
Raymond Hettinger <python@rcn.com>
parents:
20580
diff
changeset
|
144 \begin{funcdesc}{pow}{a, b} |
|
d797cfa8ca0d
Added __pow__(a,b) to the operator module. Completes the pattern of
Raymond Hettinger <python@rcn.com>
parents:
20580
diff
changeset
|
145 \funcline{__pow__}{a, b} |
|
d797cfa8ca0d
Added __pow__(a,b) to the operator module. Completes the pattern of
Raymond Hettinger <python@rcn.com>
parents:
20580
diff
changeset
|
146 Return \var{a} \code{**} \var{b}, for \var{a} and \var{b} numbers. |
|
24904
641786bea13e
Add versionadded for operator.pow
Neal Norwitz <nnorwitz@gmail.com>
parents:
24887
diff
changeset
|
147 \versionadded{2.3} |
|
24887
d797cfa8ca0d
Added __pow__(a,b) to the operator module. Completes the pattern of
Raymond Hettinger <python@rcn.com>
parents:
20580
diff
changeset
|
148 \end{funcdesc} |
|
d797cfa8ca0d
Added __pow__(a,b) to the operator module. Completes the pattern of
Raymond Hettinger <python@rcn.com>
parents:
20580
diff
changeset
|
149 |
| 6745 | 150 \begin{funcdesc}{rshift}{a, b} |
| 7603 | 151 \funcline{__rshift__}{a, b} |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
152 Return \var{a} shifted right by \var{b}. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
153 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
154 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
155 \begin{funcdesc}{sub}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
156 \funcline{__sub__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
157 Return \var{a} \code{-} \var{b}. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
158 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
159 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
160 \begin{funcdesc}{truediv}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
161 \funcline{__truediv__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
162 Return \var{a} \code{/} \var{b} when \code{__future__.division} is in |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
163 effect. This is also known as division. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
164 \versionadded{2.2} |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
165 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
166 |
|
8418
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
167 \begin{funcdesc}{xor}{a, b} |
|
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
168 \funcline{__xor__}{a, b} |
|
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
169 Return the bitwise exclusive or of \var{a} and \var{b}. |
|
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
170 \end{funcdesc} |
|
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
171 |
|
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
172 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
173 Operations which work with sequences include: |
|
8418
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
174 |
| 6745 | 175 \begin{funcdesc}{concat}{a, b} |
| 7603 | 176 \funcline{__concat__}{a, b} |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
177 Return \var{a} \code{+} \var{b} for \var{a} and \var{b} sequences. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
178 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
179 |
|
8418
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
180 \begin{funcdesc}{contains}{a, b} |
|
14655
0228914e0c5f
Added documentation for new functions.
Fred Drake <fdrake@acm.org>
parents:
10991
diff
changeset
|
181 \funcline{__contains__}{a, b} |
|
8418
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
182 Return the outcome of the test \var{b} \code{in} \var{a}. |
|
14655
0228914e0c5f
Added documentation for new functions.
Fred Drake <fdrake@acm.org>
parents:
10991
diff
changeset
|
183 Note the reversed operands. The name \function{__contains__()} was |
|
0228914e0c5f
Added documentation for new functions.
Fred Drake <fdrake@acm.org>
parents:
10991
diff
changeset
|
184 added in Python 2.0. |
|
0228914e0c5f
Added documentation for new functions.
Fred Drake <fdrake@acm.org>
parents:
10991
diff
changeset
|
185 \end{funcdesc} |
|
0228914e0c5f
Added documentation for new functions.
Fred Drake <fdrake@acm.org>
parents:
10991
diff
changeset
|
186 |
|
8418
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
187 \begin{funcdesc}{countOf}{a, b} |
|
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
188 Return the number of occurrences of \var{b} in \var{a}. |
|
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
189 \end{funcdesc} |
|
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
190 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
191 \begin{funcdesc}{delitem}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
192 \funcline{__delitem__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
193 Remove the value of \var{a} at index \var{b}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
194 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
195 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
196 \begin{funcdesc}{delslice}{a, b, c} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
197 \funcline{__delslice__}{a, b, c} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
198 Delete the slice of \var{a} from index \var{b} to index \var{c}\code{-1}. |
|
8418
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
199 \end{funcdesc} |
|
b5ff663ee76d
Document missing functions: xor, not, truth, countOf, indexOf, and
Guido van Rossum <guido@python.org>
parents:
7877
diff
changeset
|
200 |
| 6745 | 201 \begin{funcdesc}{getitem}{a, b} |
| 7603 | 202 \funcline{__getitem__}{a, b} |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
203 Return the value of \var{a} at index \var{b}. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
204 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
205 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
206 \begin{funcdesc}{getslice}{a, b, c} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
207 \funcline{__getslice__}{a, b, c} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
208 Return the slice of \var{a} from index \var{b} to index \var{c}\code{-1}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
209 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
210 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
211 \begin{funcdesc}{indexOf}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
212 Return the index of the first of occurrence of \var{b} in \var{a}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
213 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
214 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
215 \begin{funcdesc}{repeat}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
216 \funcline{__repeat__}{a, b} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
217 Return \var{a} \code{*} \var{b} where \var{a} is a sequence and |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
218 \var{b} is an integer. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
219 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
220 |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
221 \begin{funcdesc}{sequenceIncludes}{\unspecified} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
222 \deprecated{2.0}{Use \function{contains()} instead.} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
223 Alias for \function{contains()}. |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
224 \end{funcdesc} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
225 |
| 6745 | 226 \begin{funcdesc}{setitem}{a, b, c} |
| 7603 | 227 \funcline{__setitem__}{a, b, c} |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
228 Set the value of \var{a} at index \var{b} to \var{c}. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
229 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
230 |
| 6745 | 231 \begin{funcdesc}{setslice}{a, b, c, v} |
| 7603 | 232 \funcline{__setslice__}{a, b, c, v} |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
233 Set the slice of \var{a} from index \var{b} to index \var{c}\code{-1} to the |
|
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
234 sequence \var{v}. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
235 \end{funcdesc} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
236 |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
237 |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
238 The \module{operator} module also defines a few predicates to test the |
|
20580
376ee174ecd0
Use the \note and \warning macros where appropriate.
Fred Drake <fdrake@acm.org>
parents:
19132
diff
changeset
|
239 type of objects. \note{Be careful not to misinterpret the |
|
14965
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
240 results of these functions; only \function{isCallable()} has any |
|
20580
376ee174ecd0
Use the \note and \warning macros where appropriate.
Fred Drake <fdrake@acm.org>
parents:
19132
diff
changeset
|
241 measure of reliability with instance objects. For example:} |
|
14965
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
242 |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
243 \begin{verbatim} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
244 >>> class C: |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
245 ... pass |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
246 ... |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
247 >>> import operator |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
248 >>> o = C() |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
249 >>> operator.isMappingType(o) |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
250 1 |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
251 \end{verbatim} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
252 |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
253 \begin{funcdesc}{isCallable}{o} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
254 \deprecated{2.0}{Use the \function{callable()} built-in function instead.} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
255 Returns true if the object \var{o} can be called like a function, |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
256 otherwise it returns false. True is returned for functions, bound and |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
257 unbound methods, class objects, and instance objects which support the |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
258 \method{__call__()} method. |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
259 \end{funcdesc} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
260 |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
261 \begin{funcdesc}{isMappingType}{o} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
262 Returns true if the object \var{o} supports the mapping interface. |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
263 This is true for dictionaries and all instance objects. |
|
20580
376ee174ecd0
Use the \note and \warning macros where appropriate.
Fred Drake <fdrake@acm.org>
parents:
19132
diff
changeset
|
264 \warning{There is no reliable way to test if an instance |
|
14965
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
265 supports the complete mapping protocol since the interface itself is |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
266 ill-defined. This makes this test less useful than it otherwise might |
|
20580
376ee174ecd0
Use the \note and \warning macros where appropriate.
Fred Drake <fdrake@acm.org>
parents:
19132
diff
changeset
|
267 be.} |
|
14965
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
268 \end{funcdesc} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
269 |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
270 \begin{funcdesc}{isNumberType}{o} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
271 Returns true if the object \var{o} represents a number. This is true |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
272 for all numeric types implemented in C, and for all instance objects. |
|
20580
376ee174ecd0
Use the \note and \warning macros where appropriate.
Fred Drake <fdrake@acm.org>
parents:
19132
diff
changeset
|
273 \warning{There is no reliable way to test if an instance |
|
14965
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
274 supports the complete numeric interface since the interface itself is |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
275 ill-defined. This makes this test less useful than it otherwise might |
|
20580
376ee174ecd0
Use the \note and \warning macros where appropriate.
Fred Drake <fdrake@acm.org>
parents:
19132
diff
changeset
|
276 be.} |
|
14965
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
277 \end{funcdesc} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
278 |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
279 \begin{funcdesc}{isSequenceType}{o} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
280 Returns true if the object \var{o} supports the sequence protocol. |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
281 This returns true for all objects which define sequence methods in C, |
|
20580
376ee174ecd0
Use the \note and \warning macros where appropriate.
Fred Drake <fdrake@acm.org>
parents:
19132
diff
changeset
|
282 and for all instance objects. \warning{There is no reliable |
|
14965
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
283 way to test if an instance supports the complete sequence interface |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
284 since the interface itself is ill-defined. This makes this test less |
|
20580
376ee174ecd0
Use the \note and \warning macros where appropriate.
Fred Drake <fdrake@acm.org>
parents:
19132
diff
changeset
|
285 useful than it otherwise might be.} |
|
14965
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
286 \end{funcdesc} |
|
1aa37008fd2c
Add documentation and warnings for the isCallable(), isMappingType(),
Fred Drake <fdrake@acm.org>
parents:
14655
diff
changeset
|
287 |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
288 |
|
6876
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
289 Example: Build a dictionary that maps the ordinals from \code{0} to |
|
4e2cc5044fa5
Descriptions for delitem(), __delitem__(): These delete a value, not set it.
Fred Drake <fdrake@acm.org>
parents:
6871
diff
changeset
|
290 \code{256} to their character equivalents. |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
291 |
|
7277
bf4e790bd61a
Remove all \bcode / \ecode cruft; this is no longer needed. See previous
Fred Drake <fdrake@acm.org>
parents:
6955
diff
changeset
|
292 \begin{verbatim} |
|
4610
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
293 >>> import operator |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
294 >>> d = {} |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
295 >>> keys = range(256) |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
296 >>> vals = map(chr, keys) |
|
bb4094ff7bdf
Added section for operator module (compiled Skip Montanaro).
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
297 >>> map(operator.setitem, [d]*len(keys), keys, vals) |
|
7277
bf4e790bd61a
Remove all \bcode / \ecode cruft; this is no longer needed. See previous
Fred Drake <fdrake@acm.org>
parents:
6955
diff
changeset
|
298 \end{verbatim} |
|
15291
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
299 |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
300 |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
301 \subsection{Mapping Operators to Functions \label{operator-map}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
302 |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
303 This table shows how abstract operations correspond to operator |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
304 symbols in the Python syntax and the functions in the |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
305 \refmodule{operator} module. |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
306 |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
307 |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
308 \begin{tableiii}{l|c|l}{textrm}{Operation}{Syntax}{Function} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
309 \lineiii{Addition}{\code{\var{a} + \var{b}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
310 {\code{add(\var{a}, \var{b})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
311 \lineiii{Concatenation}{\code{\var{seq1} + \var{seq2}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
312 {\code{concat(\var{seq1}, \var{seq2})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
313 \lineiii{Containment Test}{\code{\var{o} in \var{seq}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
314 {\code{contains(\var{seq}, \var{o})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
315 \lineiii{Division}{\code{\var{a} / \var{b}}} |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
316 {\code{div(\var{a}, \var{b}) \#} without \code{__future__.division}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
317 \lineiii{Division}{\code{\var{a} / \var{b}}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
318 {\code{truediv(\var{a}, \var{b}) \#} with \code{__future__.division}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
319 \lineiii{Division}{\code{\var{a} // \var{b}}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
320 {\code{floordiv(\var{a}, \var{b})}} |
|
15291
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
321 \lineiii{Bitwise And}{\code{\var{a} \&\ \var{b}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
322 {\code{and_(\var{a}, \var{b})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
323 \lineiii{Bitwise Exclusive Or}{\code{\var{a} \^\ \var{b}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
324 {\code{xor(\var{a}, \var{b})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
325 \lineiii{Bitwise Inversion}{\code{\~{} \var{a}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
326 {\code{invert(\var{a})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
327 \lineiii{Bitwise Or}{\code{\var{a} | \var{b}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
328 {\code{or_(\var{a}, \var{b})}} |
|
24887
d797cfa8ca0d
Added __pow__(a,b) to the operator module. Completes the pattern of
Raymond Hettinger <python@rcn.com>
parents:
20580
diff
changeset
|
329 \lineiii{Exponentiation}{\code{\var{a} ** \var{b}}} |
|
d797cfa8ca0d
Added __pow__(a,b) to the operator module. Completes the pattern of
Raymond Hettinger <python@rcn.com>
parents:
20580
diff
changeset
|
330 {\code{pow(\var{a}, \var{b})}} |
|
28003
16b25032217f
Fill in missing table entries.
Raymond Hettinger <python@rcn.com>
parents:
27290
diff
changeset
|
331 \lineiii{Identity}{\code{\var{a} is \var{b}}} |
|
16b25032217f
Fill in missing table entries.
Raymond Hettinger <python@rcn.com>
parents:
27290
diff
changeset
|
332 {\code{is_(\var{a}, \var{b})}} |
|
16b25032217f
Fill in missing table entries.
Raymond Hettinger <python@rcn.com>
parents:
27290
diff
changeset
|
333 \lineiii{Identity}{\code{\var{a} is not \var{b}}} |
|
16b25032217f
Fill in missing table entries.
Raymond Hettinger <python@rcn.com>
parents:
27290
diff
changeset
|
334 {\code{is_not(\var{a}, \var{b})}} |
|
15291
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
335 \lineiii{Indexed Assignment}{\code{\var{o}[\var{k}] = \var{v}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
336 {\code{setitem(\var{o}, \var{k}, \var{v})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
337 \lineiii{Indexed Deletion}{\code{del \var{o}[\var{k}]}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
338 {\code{delitem(\var{o}, \var{k})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
339 \lineiii{Indexing}{\code{\var{o}[\var{k}]}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
340 {\code{getitem(\var{o}, \var{k})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
341 \lineiii{Left Shift}{\code{\var{a} <\code{<} \var{b}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
342 {\code{lshift(\var{a}, \var{b})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
343 \lineiii{Modulo}{\code{\var{a} \%\ \var{b}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
344 {\code{mod(\var{a}, \var{b})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
345 \lineiii{Multiplication}{\code{\var{a} * \var{b}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
346 {\code{mul(\var{a}, \var{b})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
347 \lineiii{Negation (Arithmetic)}{\code{- \var{a}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
348 {\code{neg(\var{a})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
349 \lineiii{Negation (Logical)}{\code{not \var{a}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
350 {\code{not_(\var{a})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
351 \lineiii{Right Shift}{\code{\var{a} >\code{>} \var{b}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
352 {\code{rshift(\var{a}, \var{b})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
353 \lineiii{Sequence Repitition}{\code{\var{seq} * \var{i}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
354 {\code{repeat(\var{seq}, \var{i})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
355 \lineiii{Slice Assignment}{\code{\var{seq}[\var{i}:\var{j}]} = \var{values}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
356 {\code{setslice(\var{seq}, \var{i}, \var{j}, \var{values})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
357 \lineiii{Slice Deletion}{\code{del \var{seq}[\var{i}:\var{j}]}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
358 {\code{delslice(\var{seq}, \var{i}, \var{j})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
359 \lineiii{Slicing}{\code{\var{seq}[\var{i}:\var{j}]}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
360 {\code{getslice(\var{seq}, \var{i}, \var{j})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
361 \lineiii{String Formatting}{\code{\var{s} \%\ \var{o}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
362 {\code{mod(\var{s}, \var{o})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
363 \lineiii{Subtraction}{\code{\var{a} - \var{b}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
364 {\code{sub(\var{a}, \var{b})}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
365 \lineiii{Truth Test}{\code{\var{o}}} |
|
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
366 {\code{truth(\var{o})}} |
|
19132
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
367 \lineiii{Ordering}{\code{\var{a} < \var{b}}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
368 {\code{lt(\var{a}, \var{b})}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
369 \lineiii{Ordering}{\code{\var{a} <= \var{b}}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
370 {\code{le(\var{a}, \var{b})}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
371 \lineiii{Equality}{\code{\var{a} == \var{b}}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
372 {\code{eq(\var{a}, \var{b})}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
373 \lineiii{Difference}{\code{\var{a} != \var{b}}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
374 {\code{ne(\var{a}, \var{b})}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
375 \lineiii{Ordering}{\code{\var{a} >= \var{b}}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
376 {\code{ge(\var{a}, \var{b})}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
377 \lineiii{Ordering}{\code{\var{a} > \var{b}}} |
|
40a17d9500a8
Added documentation for the new rich comparison support.
Fred Drake <fdrake@acm.org>
parents:
15578
diff
changeset
|
378 {\code{gt(\var{a}, \var{b})}} |
|
15291
1f9d5eb84b0b
Added missing entry for invert() function.
Fred Drake <fdrake@acm.org>
parents:
15061
diff
changeset
|
379 \end{tableiii} |
