rest25/library/operator.rst => rest262/library/operator.rst
n1- 
2-:mod:`operator` --- Standard operators as functions.
1+:mod:`operator` --- Standard operators as functions
3-====================================================
2+===================================================
4
5.. module:: operator
n5+   :synopsis: Functions corresponding to the standard operators.
6.. sectionauthor:: Skip Montanaro <skip@automatrix.com>
7
8
n9+.. testsetup::
10+ 
11+   import operator
12+   from operator import itemgetter
9
10
11The :mod:`operator` module exports a set of functions implemented in C
12corresponding to the intrinsic operators of Python.  For example,
13``operator.add(x, y)`` is equivalent to the expression ``x+y``.  The function
14names are those used for special class methods; variants without leading and
15trailing ``__`` are also provided for convenience.
16
31              __lt__(a, b)
32              __le__(a, b)
33              __eq__(a, b)
34              __ne__(a, b)
35              __ge__(a, b)
36              __gt__(a, b)
37
38   Perform "rich comparisons" between *a* and *b*. Specifically, ``lt(a, b)`` is
n39-   equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a, b)``
n43+   equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a,
40-   is equivalent to ``a == b``, ``ne(a, b)`` is equivalent to ``a != b``, ``gt(a,
44+   b)`` is equivalent to ``a == b``, ``ne(a, b)`` is equivalent to ``a != b``,
41-   b)`` is equivalent to ``a > b`` and ``ge(a, b)`` is equivalent to ``a >= b``.
45+   ``gt(a, b)`` is equivalent to ``a > b`` and ``ge(a, b)`` is equivalent to ``a
42-   Note that unlike the built-in :func:`cmp`, these functions can return any value,
46+   >= b``.  Note that unlike the built-in :func:`cmp`, these functions can
43-   which may or may not be interpretable as a Boolean value.  See the Python
47+   return any value, which may or may not be interpretable as a Boolean value.
44-   Reference Manual (XXX reference: ../ref/ref.html) for more information about
48+   See :ref:`comparisons` for more information about rich comparisons.
45-   rich comparisons.
46
47   .. versionadded:: 2.2
48
49The logical operations are also generally applicable to all objects, and support
50truth tests, identity tests, and boolean operations:
51
52
n53-.. function:: not_(o)
n56+.. function:: not_(obj)
54-              __not__(o)
57+              __not__(obj)
55
n56-   Return the outcome of :keyword:`not` *o*.  (Note that there is no
n59+   Return the outcome of :keyword:`not` *obj*.  (Note that there is no
57   :meth:`__not__` method for object instances; only the interpreter core defines
58   this operation.  The result is affected by the :meth:`__nonzero__` and
59   :meth:`__len__` methods.)
60
61
n62-.. function:: truth(o)
n65+.. function:: truth(obj)
63
n64-   Return :const:`True` if *o* is true, and :const:`False` otherwise.  This is
n67+   Return :const:`True` if *obj* is true, and :const:`False` otherwise.  This is
65   equivalent to using the :class:`bool` constructor.
66
67
68.. function:: is_(a, b)
69
70   Return ``a is b``.  Tests object identity.
71
72   .. versionadded:: 2.3
76
77   Return ``a is not b``.  Tests object identity.
78
79   .. versionadded:: 2.3
80
81The mathematical and bitwise operations are the most numerous:
82
83
n84-.. function:: abs(o)
n87+.. function:: abs(obj)
85-              __abs__(o)
88+              __abs__(obj)
86
n87-   Return the absolute value of *o*.
n90+   Return the absolute value of *obj*.
88
89
90.. function:: add(a, b)
91              __add__(a, b)
92
n93-   Return *a* ``+`` *b*, for *a* and *b* numbers.
n96+   Return ``a + b``, for *a* and *b* numbers.
94
95
96.. function:: and_(a, b)
97              __and__(a, b)
98
99   Return the bitwise and of *a* and *b*.
100
101
102.. function:: div(a, b)
103              __div__(a, b)
104
n105-   Return *a* ``/`` *b* when ``__future__.division`` is not in effect.  This is
n108+   Return ``/ b`` when ``__future__.division`` is not in effect.  This is
106   also known as "classic" division.
107
108
109.. function:: floordiv(a, b)
110              __floordiv__(a, b)
111
n112-   Return *a* ``//`` *b*.
n115+   Return ``a // b``.
113
114   .. versionadded:: 2.2
115
116
n117-.. function:: inv(o)
n120+.. function:: inv(obj)
118-              invert(o)
121+              invert(obj)
119-              __inv__(o)
122+              __inv__(obj)
120-              __invert__(o)
123+              __invert__(obj)
121
n122-   Return the bitwise inverse of the number *o*.  This is equivalent to ``~``*o*.
n125+   Return the bitwise inverse of the number *obj*.  This is equivalent to ``~obj``.
126+ 
127+   .. versionadded:: 2.0
123-   The names :func:`invert` and :func:`__invert__` were added in Python 2.0.
128+      The names :func:`invert` and :func:`__invert__`.
124
125
126.. function:: lshift(a, b)
127              __lshift__(a, b)
128
129   Return *a* shifted left by *b*.
130
131
132.. function:: mod(a, b)
133              __mod__(a, b)
134
n135-   Return *a* ``%`` *b*.
n140+   Return ``a % b``.
136
137
138.. function:: mul(a, b)
139              __mul__(a, b)
140
n141-   Return *a* ``*`` *b*, for *a* and *b* numbers.
n146+   Return ``a * b``, for *a* and *b* numbers.
142
143
n144-.. function:: neg(o)
n149+.. function:: neg(obj)
145-              __neg__(o)
150+              __neg__(obj)
146
n147-   Return *o* negated.
n152+   Return *obj* negated.
148
149
150.. function:: or_(a, b)
151              __or__(a, b)
152
153   Return the bitwise or of *a* and *b*.
154
155
n156-.. function:: pos(o)
n161+.. function:: pos(obj)
157-              __pos__(o)
162+              __pos__(obj)
158
n159-   Return *o* positive.
n164+   Return *obj* positive.
160
161
162.. function:: pow(a, b)
163              __pow__(a, b)
164
n165-   Return *a* ``**`` *b*, for *a* and *b* numbers.
n170+   Return ``a ** b``, for *a* and *b* numbers.
166
167   .. versionadded:: 2.3
168
169
170.. function:: rshift(a, b)
171              __rshift__(a, b)
172
173   Return *a* shifted right by *b*.
174
175
176.. function:: sub(a, b)
177              __sub__(a, b)
178
n179-   Return *a* ``-`` *b*.
n184+   Return ``a - b``.
180
181
182.. function:: truediv(a, b)
183              __truediv__(a, b)
184
n185-   Return *a* ``/`` *b* when ``__future__.division`` is in effect.  This is also
n190+   Return ``/ b`` when ``__future__.division`` is in effect.  This is also
186   known as "true" division.
187
188   .. versionadded:: 2.2
189
190
191.. function:: xor(a, b)
192              __xor__(a, b)
193
194   Return the bitwise exclusive or of *a* and *b*.
195
196
197.. function:: index(a)
198              __index__(a)
199
n200-   Return *a* converted to an integer.  Equivalent to *a*``.__index__()``.
n205+   Return *a* converted to an integer.  Equivalent to ``a.__index__()``.
201
202   .. versionadded:: 2.5
n208+ 
203
204Operations which work with sequences include:
n205- 
206
207.. function:: concat(a, b)
208              __concat__(a, b)
209
n210-   Return *a* ``+`` *b* for *a* and *b* sequences.
n215+   Return ``a + b`` for *a* and *b* sequences.
211
212
213.. function:: contains(a, b)
214              __contains__(a, b)
215
n216-   Return the outcome of the test *b* ``in`` *a*. Note the reversed operands.  The
n221+   Return the outcome of the test ``in a``. Note the reversed operands.
217-   name :func:`__contains__` was added in Python 2.0.
222+ 
223+   .. versionadded:: 2.0
224+      The name :func:`__contains__`.
218
219
220.. function:: countOf(a, b)
221
222   Return the number of occurrences of *b* in *a*.
223
224
225.. function:: delitem(a, b)
226              __delitem__(a, b)
227
228   Remove the value of *a* at index *b*.
229
230
231.. function:: delslice(a, b, c)
232              __delslice__(a, b, c)
233
n234-   Delete the slice of *a* from index *b* to index *c*``-1``.
n241+   Delete the slice of *a* from index *b* to index *c-1*.
242+ 
243+   .. deprecated:: 2.6
244+      This function is removed in Python 3.0.  Use :func:`delitem` with a slice
245+      index.
235
236
237.. function:: getitem(a, b)
238              __getitem__(a, b)
239
240   Return the value of *a* at index *b*.
241
242
243.. function:: getslice(a, b, c)
244              __getslice__(a, b, c)
245
n246-   Return the slice of *a* from index *b* to index *c*``-1``.
n257+   Return the slice of *a* from index *b* to index *c-1*.
258+ 
259+   .. deprecated:: 2.6
260+      This function is removed in Python 3.0.  Use :func:`getitem` with a slice
261+      index.
247
248
249.. function:: indexOf(a, b)
250
251   Return the index of the first of occurrence of *b* in *a*.
252
253
254.. function:: repeat(a, b)
255              __repeat__(a, b)
256
n272+   .. deprecated:: 2.6
273+      This function is removed in Python 3.0.  Use :func:`__mul__` instead.
274+ 
257-   Return *a* ``*`` *b* where *a* is a sequence and *b* is an integer.
275+   Return ``* b`` where *a* is a sequence and *b* is an integer.
258
259
260.. function:: sequenceIncludes(...)
261
262   .. deprecated:: 2.0
263      Use :func:`contains` instead.
264
265   Alias for :func:`contains`.
269              __setitem__(a, b, c)
270
271   Set the value of *a* at index *b* to *c*.
272
273
274.. function:: setslice(a, b, c, v)
275              __setslice__(a, b, c, v)
276
n277-   Set the slice of *a* from index *b* to index *c*``-1`` to the sequence *v*.
n295+   Set the slice of *a* from index *b* to index *c-1* to the sequence *v*.
296+ 
297+   .. deprecated:: 2.6
298+      This function is removed in Python 3.0.  Use :func:`setitem` with a slice
299+      index.
300+ 
301+Example use of operator functions::
302+ 
303+    >>> # Elementwise multiplication
304+    >>> map(mul, [0, 1, 2, 3], [10, 20, 30, 40])
305+    [0, 20, 60, 120]
306+ 
307+    >>> # Dot product
308+    >>> sum(map(mul, [0, 1, 2, 3], [10, 20, 30, 40]))
309+    200
278
279Many operations have an "in-place" version.  The following functions provide a
280more primitive access to in-place operators than the usual syntax does; for
n281-example, the statement ``x += y`` is equivalent to ``x = operator.iadd(x, y)``.
n313+example, the :term:`statement` ``x += y`` is equivalent to
282-Another way to put it is to say that ``z = operator.iadd(x, y)`` is equivalent
314+``x = operator.iadd(x, y)``.  Another way to put it is to say that
283-to the compound statement ``z = x; z += y``.
315+``z = operator.iadd(x, y)`` is equivalent to the compound statement
284- 
316+``z = x; z += y``.
285
286.. function:: iadd(a, b)
287              __iadd__(a, b)
288
289   ``a = iadd(a, b)`` is equivalent to ``a += b``.
290
291   .. versionadded:: 2.5
292
362   ``a = ipow(a, b)`` is equivalent to ``a **= b``.
363
364   .. versionadded:: 2.5
365
366
367.. function:: irepeat(a, b)
368              __irepeat__(a, b)
369
n402+   .. deprecated:: 2.6
403+      This function is removed in Python 3.0.  Use :func:`__imul__` instead.
404+ 
370   ``a = irepeat(a, b)`` is equivalent to ``a *= b`` where *a* is a sequence and
371   *b* is an integer.
372
373   .. versionadded:: 2.5
374
375
376.. function:: irshift(a, b)
377              __irshift__(a, b)
400
401.. function:: ixor(a, b)
402              __ixor__(a, b)
403
404   ``a = ixor(a, b)`` is equivalent to ``a ^= b``.
405
406   .. versionadded:: 2.5
407
n443+ 
408The :mod:`operator` module also defines a few predicates to test the type of
n409-objects.
n445+objects; however, these are not all reliable.  It is preferable to test
446+abstract base classes instead (see :mod:`collections` and
447+:mod:`numbers` for details).
410
n411-.. note::
412- 
413-   Be careful not to misinterpret the results of these functions; only
414-   :func:`isCallable` has any measure of reliability with instance objects.  For
415-   example:
416- 
417-::
418- 
419-   >>> class C:
420-   ...     pass
421-   ... 
422-   >>> import operator
423-   >>> o = C()
424-   >>> operator.isMappingType(o)
425-   True
426- 
427- 
428-.. function:: isCallable(o)
449+.. function:: isCallable(obj)
429
430   .. deprecated:: 2.0
n431-      Use the :func:`callable` built-in function instead.
n452+      Use ``isinstance(x, collections.Callable)`` instead.
432
n433-   Returns true if the object *o* can be called like a function, otherwise it
n454+   Returns true if the object *obj* can be called like a function, otherwise it
434   returns false.  True is returned for functions, bound and unbound methods, class
435   objects, and instance objects which support the :meth:`__call__` method.
436
437
n438-.. function:: isMappingType(o)
n459+.. function:: isMappingType(obj)
439
n461+   .. deprecated:: 2.6
462+      This function is removed in Python 3.0.  Use ``isinstance(x, collections.Mapping)`` instead.
463+ 
440-   Returns true if the object *o* supports the mapping interface. This is true for
464+   Returns true if the object *obj* supports the mapping interface. This is true for
441   dictionaries and all instance objects defining :meth:`__getitem__`.
442
n443-   .. warning::
444
n445-      There is no reliable way to test if an instance supports the complete mapping
446-      protocol since the interface itself is ill-defined.  This makes this test less
447-      useful than it otherwise might be.
448- 
449- 
450-.. function:: isNumberType(o)
468+.. function:: isNumberType(obj)
451
n470+   .. deprecated:: 2.6
471+      This function is removed in Python 3.0.  Use ``isinstance(x, numbers.Number)`` instead.
472+ 
452-   Returns true if the object *o* represents a number.  This is true for all
473+   Returns true if the object *obj* represents a number.  This is true for all
453   numeric types implemented in C.
454
n455-   .. warning::
456
n457-      There is no reliable way to test if an instance supports the complete numeric
458-      interface since the interface itself is ill-defined.  This makes this test less
459-      useful than it otherwise might be.
460- 
461- 
462-.. function:: isSequenceType(o)
477+.. function:: isSequenceType(obj)
463
n479+   .. deprecated:: 2.6
480+      This function is removed in Python 3.0.  Use ``isinstance(x, collections.Sequence)`` instead.
481+ 
464-   Returns true if the object *o* supports the sequence protocol. This returns true
482+   Returns true if the object *obj* supports the sequence protocol. This returns true
465   for all objects which define sequence methods in C, and for all instance objects
466   defining :meth:`__getitem__`.
467
n468-   .. warning::
469- 
470-      There is no reliable way to test if an instance supports the complete sequence
471-      interface since the interface itself is ill-defined.  This makes this test less
472-      useful than it otherwise might be.
473- 
474-Example: Build a dictionary that maps the ordinals from ``0`` to ``255`` to
475-their character equivalents. ::
476- 
477-   >>> import operator
478-   >>> d = {}
479-   >>> keys = range(256)
480-   >>> vals = map(chr, keys)
481-   >>> map(operator.setitem, [d]*len(keys), keys, vals)
482
483The :mod:`operator` module also defines tools for generalized attribute and item
484lookups.  These are useful for making fast field extractors as arguments for
485:func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or other functions that
486expect a function argument.
487
488
489.. function:: attrgetter(attr[, args...])
490
491   Return a callable object that fetches *attr* from its operand. If more than one
492   attribute is requested, returns a tuple of attributes. After,
n493-   ``f=attrgetter('name')``, the call ``f(b)`` returns ``b.name``.  After,
n497+   ``f = attrgetter('name')``, the call ``f(b)`` returns ``b.name``.  After,
494-   ``f=attrgetter('name', 'date')``, the call ``f(b)`` returns ``(b.name,
498+   ``f = attrgetter('name', 'date')``, the call ``f(b)`` returns ``(b.name,
495   b.date)``.
n500+ 
501+   The attribute names can also contain dots; after ``f = attrgetter('date.month')``,
502+   the call ``f(b)`` returns ``b.date.month``.
496
497   .. versionadded:: 2.4
498
499   .. versionchanged:: 2.5
500      Added support for multiple attributes.
501
n509+   .. versionchanged:: 2.6
510+      Added support for dotted attributes.
511+ 
502
503.. function:: itemgetter(item[, args...])
504
n505-   Return a callable object that fetches *item* from its operand. If more than one
n515+   Return a callable object that fetches *item* from its operand using the
506-   item is requested, returns a tuple of items. After, ``f=itemgetter(2)``, the
516+   operand's :meth:`__getitem__` method.  If multiple items are specified,
507-   call ``f(b)`` returns ``b[2]``. After, ``f=itemgetter(2,5,3)``, the call
517+   returns a tuple of lookup values.  Equivalent to::
508-   ``f(b)`` returns ``(b[2], b[5], b[3])``.
518+ 
519+        def itemgetter(*items):
520+            if len(items) == 1:
521+                item = items[0]
522+                def g(obj):
523+                    return obj[item]
524+            else:
525+                def g(obj):
526+                    return tuple(obj[item] for item in items)
527+            return g
528+ 
529+   The items can be any type accepted by the operand's :meth:`__getitem__`
530+   method.  Dictionaries accept any hashable value.  Lists, tuples, and
531+   strings accept an index or a slice:
532+ 
533+      >>> itemgetter(1)('ABCDEFG')
534+      'B'
535+      >>> itemgetter(1,3,5)('ABCDEFG')
536+      ('B', 'D', 'F')
537+      >>> itemgetter(slice(2,None))('ABCDEFG')
538+      'CDEFG'
509
510   .. versionadded:: 2.4
511
512   .. versionchanged:: 2.5
513      Added support for multiple item extraction.
514
n515-Examples::
n545+   Example of using :func:`itemgetter` to retrieve specific fields from a
546+   tuple record:
516
n517-   >>> from operator import itemgetter
518-   >>> inventory = [('apple', 3), ('banana', 2), ('pear', 5), ('orange', 1)]
548+       >>> inventory = [('apple', 3), ('banana', 2), ('pear', 5), ('orange', 1)]
519-   >>> getcount = itemgetter(1)
549+       >>> getcount = itemgetter(1)
520-   >>> map(getcount, inventory)
550+       >>> map(getcount, inventory)
521-   [3, 2, 5, 1]
551+       [3, 2, 5, 1]
522-   >>> sorted(inventory, key=getcount)
552+       >>> sorted(inventory, key=getcount)
523-   [('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
553+       [('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
554+ 
555+ 
556+.. function:: methodcaller(name[, args...])
557+ 
558+   Return a callable object that calls the method *name* on its operand.  If
559+   additional arguments and/or keyword arguments are given, they will be given
560+   to the method as well.  After ``f = methodcaller('name')``, the call ``f(b)``
561+   returns ``b.name()``.  After ``f = methodcaller('name', 'foo', bar=1)``, the
562+   call ``f(b)`` returns ``b.name('foo', bar=1)``.
563+ 
564+   .. versionadded:: 2.6
524
525
526.. _operator-map:
527
528Mapping Operators to Functions
529------------------------------
530
531This table shows how abstract operations correspond to operator symbols in the
533
534+-----------------------+-------------------------+---------------------------------+
535| Operation             | Syntax                  | Function                        |
536+=======================+=========================+=================================+
537| Addition              | ``a + b``               | ``add(a, b)``                   |
538+-----------------------+-------------------------+---------------------------------+
539| Concatenation         | ``seq1 + seq2``         | ``concat(seq1, seq2)``          |
540+-----------------------+-------------------------+---------------------------------+
n541-| Containment Test      | ``o in seq``            | ``contains(seq, o)``            |
n582+| Containment Test      | ``obj in seq``          | ``contains(seq, obj)``          |
542+-----------------------+-------------------------+---------------------------------+
n543-| Division              | ``a / b``               | ``div(a, b) #`` without         |
n584+| Division              | ``a / b``               | ``div(a, b)`` (without          |
544-|                       |                         | ``__future__.division``         |
585+|                       |                         | ``__future__.division``)        |
545+-----------------------+-------------------------+---------------------------------+
n546-| Division              | ``a / b``               | ``truediv(a, b) #`` with        |
n587+| Division              | ``a / b``               | ``truediv(a, b)`` (with         |
547-|                       |                         | ``__future__.division``         |
588+|                       |                         | ``__future__.division``)        |
548+-----------------------+-------------------------+---------------------------------+
549| Division              | ``a // b``              | ``floordiv(a, b)``              |
550+-----------------------+-------------------------+---------------------------------+
551| Bitwise And           | ``a & b``               | ``and_(a, b)``                  |
552+-----------------------+-------------------------+---------------------------------+
553| Bitwise Exclusive Or  | ``a ^ b``               | ``xor(a, b)``                   |
554+-----------------------+-------------------------+---------------------------------+
555| Bitwise Inversion     | ``~ a``                 | ``invert(a)``                   |
557| Bitwise Or            | ``a | b``               | ``or_(a, b)``                   |
558+-----------------------+-------------------------+---------------------------------+
559| Exponentiation        | ``a ** b``              | ``pow(a, b)``                   |
560+-----------------------+-------------------------+---------------------------------+
561| Identity              | ``a is b``              | ``is_(a, b)``                   |
562+-----------------------+-------------------------+---------------------------------+
563| Identity              | ``a is not b``          | ``is_not(a, b)``                |
564+-----------------------+-------------------------+---------------------------------+
n565-| Indexed Assignment    | ``o[k] = v``            | ``setitem(o, k, v)``            |
n606+| Indexed Assignment    | ``obj[k] = v``          | ``setitem(obj, k, v)``          |
566+-----------------------+-------------------------+---------------------------------+
n567-| Indexed Deletion      | ``del o[k]``            | ``delitem(o, k)``               |
n608+| Indexed Deletion      | ``del obj[k]``          | ``delitem(obj, k)``             |
568+-----------------------+-------------------------+---------------------------------+
n569-| Indexing              | ``o[k]``                | ``getitem(o, k)``               |
n610+| Indexing              | ``obj[k]``              | ``getitem(obj, k)``             |
570+-----------------------+-------------------------+---------------------------------+
571| Left Shift            | ``a << b``              | ``lshift(a, b)``                |
572+-----------------------+-------------------------+---------------------------------+
573| Modulo                | ``a % b``               | ``mod(a, b)``                   |
574+-----------------------+-------------------------+---------------------------------+
575| Multiplication        | ``a * b``               | ``mul(a, b)``                   |
576+-----------------------+-------------------------+---------------------------------+
577| Negation (Arithmetic) | ``- a``                 | ``neg(a)``                      |
578+-----------------------+-------------------------+---------------------------------+
579| Negation (Logical)    | ``not a``               | ``not_(a)``                     |
580+-----------------------+-------------------------+---------------------------------+
581| Right Shift           | ``a >> b``              | ``rshift(a, b)``                |
582+-----------------------+-------------------------+---------------------------------+
n583-| Sequence Repitition   | ``seq * i``             | ``repeat(seq, i)``              |
n624+| Sequence Repetition   | ``seq * i``             | ``repeat(seq, i)``              |
584+-----------------------+-------------------------+---------------------------------+
n585-| Slice Assignment      | ``seq[i:j]`` = *values* | ``setslice(seq, i, j, values)`` |
n626+| Slice Assignment      | ``seq[i:j] = values``   | ``setslice(seq, i, j, values)`` |
586+-----------------------+-------------------------+---------------------------------+
587| Slice Deletion        | ``del seq[i:j]``        | ``delslice(seq, i, j)``         |
588+-----------------------+-------------------------+---------------------------------+
589| Slicing               | ``seq[i:j]``            | ``getslice(seq, i, j)``         |
590+-----------------------+-------------------------+---------------------------------+
n591-| String Formatting     | ``s % o``               | ``mod(s, o)``                   |
n632+| String Formatting     | ``s % obj``             | ``mod(s, obj)``                 |
592+-----------------------+-------------------------+---------------------------------+
593| Subtraction           | ``a - b``               | ``sub(a, b)``                   |
594+-----------------------+-------------------------+---------------------------------+
t595-| Truth Test            | ``o``                   | ``truth(o)``                    |
t636+| Truth Test            | ``obj``                 | ``truth(obj)``                  |
596+-----------------------+-------------------------+---------------------------------+
597| Ordering              | ``a < b``               | ``lt(a, b)``                    |
598+-----------------------+-------------------------+---------------------------------+
599| Ordering              | ``a <= b``              | ``le(a, b)``                    |
600+-----------------------+-------------------------+---------------------------------+
601| Equality              | ``a == b``              | ``eq(a, b)``                    |
602+-----------------------+-------------------------+---------------------------------+
603| Difference            | ``a != b``              | ``ne(a, b)``                    |
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op