~ubuntu-branches/ubuntu/precise/python3.2/precise-proposed

« back to all changes in this revision

Viewing changes to Doc/library/operator.rst

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 18:40:39 UTC
  • mfrom: (30.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120309184039-j3yk2emxr1plyo21
Tags: 3.2.3~rc1-1
* Python 3.2.3 release candidate 1.
* Update to 20120309 from the 3.2 branch.
* Fix libpython.a symlink. Closes: #660146.
* Build-depend on xauth.
* Run the gdb tests for the debug build only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
   from operator import itemgetter, iadd
13
13
 
14
14
 
15
 
The :mod:`operator` module exports a set of functions implemented in C
16
 
corresponding to the intrinsic operators of Python.  For example,
17
 
``operator.add(x, y)`` is equivalent to the expression ``x+y``.  The function
18
 
names are those used for special class methods; variants without leading and
19
 
trailing ``__`` are also provided for convenience.
 
15
The :mod:`operator` module exports a set of efficient functions corresponding to
 
16
the intrinsic operators of Python.  For example, ``operator.add(x, y)`` is
 
17
equivalent to the expression ``x+y``.  The function names are those used for
 
18
special class methods; variants without leading and trailing ``__`` are also
 
19
provided for convenience.
20
20
 
21
21
The functions fall into categories that perform object comparisons, logical
22
22
operations, mathematical operations and sequence operations.
378
378
+-----------------------+-------------------------+---------------------------------------+
379
379
| Right Shift           | ``a >> b``              | ``rshift(a, b)``                      |
380
380
+-----------------------+-------------------------+---------------------------------------+
381
 
| Sequence Repetition   | ``seq * i``             | ``repeat(seq, i)``                    |
382
 
+-----------------------+-------------------------+---------------------------------------+
383
381
| Slice Assignment      | ``seq[i:j] = values``   | ``setitem(seq, slice(i, j), values)`` |
384
382
+-----------------------+-------------------------+---------------------------------------+
385
383
| Slice Deletion        | ``del seq[i:j]``        | ``delitem(seq, slice(i, j))``         |