Merged revisions 75952-75953,75955,76105,76143,76223,76259,76326,76376-76377 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75952 | georg.brandl | 2009-10-29 21:38:32 +0100 (Do, 29 Okt 2009) | 1 line

  Use the correct function name in docstring.
........
  r75953 | georg.brandl | 2009-10-29 21:39:50 +0100 (Do, 29 Okt 2009) | 1 line

  Remove mention of the old -X command line switch.
........
  r75955 | georg.brandl | 2009-10-29 21:54:03 +0100 (Do, 29 Okt 2009) | 1 line

  Use a single style for all the docstrings in the math module.
........
  r76105 | georg.brandl | 2009-11-04 08:38:12 +0100 (Mi, 04 Nov 2009) | 1 line

  #7259: show correct equivalent for operator.i* operations in docstring; fix minor issues in operator docs.
........
  r76143 | georg.brandl | 2009-11-07 09:26:07 +0100 (Sa, 07 Nov 2009) | 1 line

  #7271: fix typo.
........
  r76223 | georg.brandl | 2009-11-12 09:29:46 +0100 (Do, 12 Nov 2009) | 1 line

  Give the profile module a module directive.
........
  r76259 | georg.brandl | 2009-11-14 12:50:51 +0100 (Sa, 14 Nov 2009) | 1 line

  Fix terminology.
........
  r76326 | georg.brandl | 2009-11-16 17:44:05 +0100 (Mo, 16 Nov 2009) | 1 line

  #7302: fix link.
........
  r76376 | georg.brandl | 2009-11-18 20:39:14 +0100 (Mi, 18 Nov 2009) | 1 line

  upcase Python
........
  r76377 | georg.brandl | 2009-11-18 21:05:15 +0100 (Mi, 18 Nov 2009) | 1 line

  Fix markup.
........
This commit is contained in:
Georg Brandl 2010-03-21 19:01:15 +00:00
parent faf131e1a3
commit 46d441e0c2
10 changed files with 136 additions and 130 deletions

View File

@ -173,7 +173,7 @@ available. They are listed here in alphabetical order.
.. note:: .. note::
When compiling a string with multi-line statements, line endings must be When compiling a string with multi-line code, line endings must be
represented by a single newline character (``'\n'``), and the input must represented by a single newline character (``'\n'``), and the input must
be terminated by at least one newline character. If line endings are be terminated by at least one newline character. If line endings are
represented by ``'\r\n'``, use :meth:`str.replace` to change them into represented by ``'\r\n'``, use :meth:`str.replace` to change them into

View File

@ -117,6 +117,14 @@ The mathematical and bitwise operations are the most numerous:
.. versionadded:: 2.2 .. versionadded:: 2.2
.. function:: index(a)
__index__(a)
Return *a* converted to an integer. Equivalent to ``a.__index__()``.
.. versionadded:: 2.5
.. function:: inv(obj) .. function:: inv(obj)
invert(obj) invert(obj)
__inv__(obj) __inv__(obj)
@ -149,7 +157,7 @@ The mathematical and bitwise operations are the most numerous:
.. function:: neg(obj) .. function:: neg(obj)
__neg__(obj) __neg__(obj)
Return *obj* negated. Return *obj* negated (``-obj``).
.. function:: or_(a, b) .. function:: or_(a, b)
@ -161,7 +169,7 @@ The mathematical and bitwise operations are the most numerous:
.. function:: pos(obj) .. function:: pos(obj)
__pos__(obj) __pos__(obj)
Return *obj* positive. Return *obj* positive (``+obj``).
.. function:: pow(a, b) .. function:: pow(a, b)
@ -199,15 +207,7 @@ The mathematical and bitwise operations are the most numerous:
Return the bitwise exclusive or of *a* and *b*. Return the bitwise exclusive or of *a* and *b*.
.. function:: index(a) Operations which work with sequences (some of them with mappings too) include:
__index__(a)
Return *a* converted to an integer. Equivalent to ``a.__index__()``.
.. versionadded:: 2.5
Operations which work with sequences include:
.. function:: concat(a, b) .. function:: concat(a, b)
__concat__(a, b) __concat__(a, b)
@ -359,7 +359,7 @@ example, the :term:`statement` ``x += y`` is equivalent to
.. function:: ilshift(a, b) .. function:: ilshift(a, b)
__ilshift__(a, b) __ilshift__(a, b)
``a = ilshift(a, b)`` is equivalent to ``a <``\ ``<= b``. ``a = ilshift(a, b)`` is equivalent to ``a <<= b``.
.. versionadded:: 2.5 .. versionadded:: 2.5
@ -572,79 +572,81 @@ Mapping Operators to Functions
This table shows how abstract operations correspond to operator symbols in the This table shows how abstract operations correspond to operator symbols in the
Python syntax and the functions in the :mod:`operator` module. Python syntax and the functions in the :mod:`operator` module.
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Operation | Syntax | Function | | Operation | Syntax | Function |
+=======================+=========================+=================================+ +=======================+=========================+=======================================+
| Addition | ``a + b`` | ``add(a, b)`` | | Addition | ``a + b`` | ``add(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Concatenation | ``seq1 + seq2`` | ``concat(seq1, seq2)`` | | Concatenation | ``seq1 + seq2`` | ``concat(seq1, seq2)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Containment Test | ``obj in seq`` | ``contains(seq, obj)`` | | Containment Test | ``obj in seq`` | ``contains(seq, obj)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Division | ``a / b`` | ``div(a, b)`` (without | | Division | ``a / b`` | ``div(a, b)`` (without |
| | | ``__future__.division``) | | | | ``__future__.division``) |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Division | ``a / b`` | ``truediv(a, b)`` (with | | Division | ``a / b`` | ``truediv(a, b)`` (with |
| | | ``__future__.division``) | | | | ``__future__.division``) |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Division | ``a // b`` | ``floordiv(a, b)`` | | Division | ``a // b`` | ``floordiv(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Bitwise And | ``a & b`` | ``and_(a, b)`` | | Bitwise And | ``a & b`` | ``and_(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Bitwise Exclusive Or | ``a ^ b`` | ``xor(a, b)`` | | Bitwise Exclusive Or | ``a ^ b`` | ``xor(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Bitwise Inversion | ``~ a`` | ``invert(a)`` | | Bitwise Inversion | ``~ a`` | ``invert(a)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Bitwise Or | ``a | b`` | ``or_(a, b)`` | | Bitwise Or | ``a | b`` | ``or_(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Exponentiation | ``a ** b`` | ``pow(a, b)`` | | Exponentiation | ``a ** b`` | ``pow(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Identity | ``a is b`` | ``is_(a, b)`` | | Identity | ``a is b`` | ``is_(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Identity | ``a is not b`` | ``is_not(a, b)`` | | Identity | ``a is not b`` | ``is_not(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Indexed Assignment | ``obj[k] = v`` | ``setitem(obj, k, v)`` | | Indexed Assignment | ``obj[k] = v`` | ``setitem(obj, k, v)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Indexed Deletion | ``del obj[k]`` | ``delitem(obj, k)`` | | Indexed Deletion | ``del obj[k]`` | ``delitem(obj, k)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Indexing | ``obj[k]`` | ``getitem(obj, k)`` | | Indexing | ``obj[k]`` | ``getitem(obj, k)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Left Shift | ``a << b`` | ``lshift(a, b)`` | | Left Shift | ``a << b`` | ``lshift(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Modulo | ``a % b`` | ``mod(a, b)`` | | Modulo | ``a % b`` | ``mod(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Multiplication | ``a * b`` | ``mul(a, b)`` | | Multiplication | ``a * b`` | ``mul(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Negation (Arithmetic) | ``- a`` | ``neg(a)`` | | Negation (Arithmetic) | ``- a`` | ``neg(a)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Negation (Logical) | ``not a`` | ``not_(a)`` | | Negation (Logical) | ``not a`` | ``not_(a)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Right Shift | ``a >> b`` | ``rshift(a, b)`` | | Positive | ``+ a`` | ``pos(a)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Sequence Repetition | ``seq * i`` | ``repeat(seq, i)`` | | Right Shift | ``a >> b`` | ``rshift(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Slice Assignment | ``seq[i:j] = values`` | ``setslice(seq, i, j, values)`` | | Sequence Repetition | ``seq * i`` | ``repeat(seq, i)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Slice Deletion | ``del seq[i:j]`` | ``delslice(seq, i, j)`` | | Slice Assignment | ``seq[i:j] = values`` | ``setitem(seq, slice(i, j), values)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Slicing | ``seq[i:j]`` | ``getslice(seq, i, j)`` | | Slice Deletion | ``del seq[i:j]`` | ``delitem(seq, slice(i, j))`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| String Formatting | ``s % obj`` | ``mod(s, obj)`` | | Slicing | ``seq[i:j]`` | ``getitem(seq, slice(i, j))`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Subtraction | ``a - b`` | ``sub(a, b)`` | | String Formatting | ``s % obj`` | ``mod(s, obj)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Truth Test | ``obj`` | ``truth(obj)`` | | Subtraction | ``a - b`` | ``sub(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Ordering | ``a < b`` | ``lt(a, b)`` | | Truth Test | ``obj`` | ``truth(obj)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Ordering | ``a <= b`` | ``le(a, b)`` | | Ordering | ``a < b`` | ``lt(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Equality | ``a == b`` | ``eq(a, b)`` | | Ordering | ``a <= b`` | ``le(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Difference | ``a != b`` | ``ne(a, b)`` | | Equality | ``a == b`` | ``eq(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Ordering | ``a >= b`` | ``ge(a, b)`` | | Difference | ``a != b`` | ``ne(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Ordering | ``a > b`` | ``gt(a, b)`` | | Ordering | ``a >= b`` | ``ge(a, b)`` |
+-----------------------+-------------------------+---------------------------------+ +-----------------------+-------------------------+---------------------------------------+
| Ordering | ``a > b`` | ``gt(a, b)`` |
+-----------------------+-------------------------+---------------------------------------+

View File

@ -7,6 +7,8 @@ The Python Profilers
.. sectionauthor:: James Roskind .. sectionauthor:: James Roskind
.. module:: profile
:synopsis: Python source profiler.
.. index:: single: InfoSeek Corporation .. index:: single: InfoSeek Corporation

View File

@ -548,13 +548,12 @@ these rules. The methods of :class:`Template` are:
templates containing dangling delimiters, unmatched braces, or templates containing dangling delimiters, unmatched braces, or
placeholders that are not valid Python identifiers. placeholders that are not valid Python identifiers.
:class:`Template` instances also provide one public data attribute: :class:`Template` instances also provide one public data attribute:
.. attribute:: template
.. attribute:: string.template This is the object passed to the constructor's *template* argument. In
general, you shouldn't change it, but read-only access is not enforced.
This is the object passed to the constructor's *template* argument. In general,
you shouldn't change it, but read-only access is not enforced.
Here is an example of how to use a Template: Here is an example of how to use a Template:

View File

@ -1901,7 +1901,7 @@ The public classes of the module :mod:`turtle`
Subclass of TurtleScreen, with :ref:`four methods added <screenspecific>`. Subclass of TurtleScreen, with :ref:`four methods added <screenspecific>`.
.. class:: ScrolledCavas(master) .. class:: ScrolledCanvas(master)
:param master: some Tkinter widget to contain the ScrolledCanvas, i.e. :param master: some Tkinter widget to contain the ScrolledCanvas, i.e.
a Tkinter-canvas with scrollbars added a Tkinter-canvas with scrollbars added

View File

@ -79,7 +79,7 @@ implementations are free to support the strict mapping from IDL). See section
`Document Object Model (DOM) Level 1 Specification <http://www.w3.org/TR/REC-DOM-Level-1/>`_ `Document Object Model (DOM) Level 1 Specification <http://www.w3.org/TR/REC-DOM-Level-1/>`_
The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`. The W3C recommendation for the DOM supported by :mod:`xml.dom.minidom`.
`Python Language Mapping Specification <http://www.omg.org/docs/formal/02-11-05.pdf>`_ `Python Language Mapping Specification <http://www.omg.org/spec/PYTH/1.2/PDF>`_
This specifies the mapping from OMG IDL to Python. This specifies the mapping from OMG IDL to Python.

View File

@ -22,7 +22,7 @@ documentation). It can handle ZIP files that use the ZIP64 extensions
(that is ZIP files that are more than 4 GByte in size). It supports (that is ZIP files that are more than 4 GByte in size). It supports
decryption of encrypted files in ZIP archives, but it currently cannot decryption of encrypted files in ZIP archives, but it currently cannot
create an encrypted file. Decryption is extremely slow as it is create an encrypted file. Decryption is extremely slow as it is
implemented in native python rather than C. implemented in native Python rather than C.
For other archive formats, see the :mod:`bz2`, :mod:`gzip`, and For other archive formats, see the :mod:`bz2`, :mod:`gzip`, and
:mod:`tarfile` modules. :mod:`tarfile` modules.

View File

@ -31,8 +31,7 @@ target platform. Forget about the posix module for now -- simply take
it out of the config.c file. it out of the config.c file.
Bang on it until you get a >>> prompt. (You may have to disable the Bang on it until you get a >>> prompt. (You may have to disable the
importing of "site.py" and "exceptions.py" by passing -X and -S importing of "site.py" by passing the -S options.)
options.
Then bang on it until it executes very simple Python statements. Then bang on it until it executes very simple Python statements.

View File

@ -338,7 +338,7 @@ FUNC1(ceil, ceil, 0,
"ceil(x)\n\nReturn the ceiling of x as a float.\n" "ceil(x)\n\nReturn the ceiling of x as a float.\n"
"This is the smallest integral value >= x.") "This is the smallest integral value >= x.")
FUNC2(copysign, copysign, FUNC2(copysign, copysign,
"copysign(x,y)\n\nReturn x with the sign of y.") "copysign(x, y)\n\nReturn x with the sign of y.")
FUNC1(cos, cos, 0, FUNC1(cos, cos, 0,
"cos(x)\n\nReturn the cosine of x (measured in radians).") "cos(x)\n\nReturn the cosine of x (measured in radians).")
FUNC1(cosh, cosh, 1, FUNC1(cosh, cosh, 1,
@ -351,8 +351,8 @@ FUNC1(floor, floor, 0,
"floor(x)\n\nReturn the floor of x as a float.\n" "floor(x)\n\nReturn the floor of x as a float.\n"
"This is the largest integral value <= x.") "This is the largest integral value <= x.")
FUNC1(log1p, log1p, 1, FUNC1(log1p, log1p, 1,
"log1p(x)\n\nReturn the natural logarithm of 1+x (base e).\n\ "log1p(x)\n\nReturn the natural logarithm of 1+x (base e).\n"
The result is computed in a way which is accurate for x near zero.") "The result is computed in a way which is accurate for x near zero.")
FUNC1(sin, sin, 0, FUNC1(sin, sin, 0,
"sin(x)\n\nReturn the sine of x (measured in radians).") "sin(x)\n\nReturn the sine of x (measured in radians).")
FUNC1(sinh, sinh, 1, FUNC1(sinh, sinh, 1,
@ -581,7 +581,7 @@ _fsum_error:
#undef NUM_PARTIALS #undef NUM_PARTIALS
PyDoc_STRVAR(math_fsum_doc, PyDoc_STRVAR(math_fsum_doc,
"sum(iterable)\n\n\ "fsum(iterable)\n\n\
Return an accurate floating point sum of values in the iterable.\n\ Return an accurate floating point sum of values in the iterable.\n\
Assumes IEEE-754 floating point arithmetic."); Assumes IEEE-754 floating point arithmetic.");
@ -739,7 +739,8 @@ math_ldexp(PyObject *self, PyObject *args)
} }
PyDoc_STRVAR(math_ldexp_doc, PyDoc_STRVAR(math_ldexp_doc,
"ldexp(x, i) -> x * (2**i)"); "ldexp(x, i)\n\n\
Return x * (2**i).");
static PyObject * static PyObject *
math_modf(PyObject *self, PyObject *arg) math_modf(PyObject *self, PyObject *arg)
@ -830,7 +831,8 @@ math_log(PyObject *self, PyObject *args)
} }
PyDoc_STRVAR(math_log_doc, PyDoc_STRVAR(math_log_doc,
"log(x[, base]) -> the logarithm of x to the given base.\n\ "log(x[, base])\n\n\
Return the logarithm of x to the given base.\n\
If the base not specified, returns the natural logarithm (base e) of x."); If the base not specified, returns the natural logarithm (base e) of x.");
static PyObject * static PyObject *
@ -840,7 +842,7 @@ math_log10(PyObject *self, PyObject *arg)
} }
PyDoc_STRVAR(math_log10_doc, PyDoc_STRVAR(math_log10_doc,
"log10(x) -> the base 10 logarithm of x."); "log10(x)\n\nReturn the base 10 logarithm of x.");
static PyObject * static PyObject *
math_fmod(PyObject *self, PyObject *args) math_fmod(PyObject *self, PyObject *args)
@ -873,7 +875,7 @@ math_fmod(PyObject *self, PyObject *args)
} }
PyDoc_STRVAR(math_fmod_doc, PyDoc_STRVAR(math_fmod_doc,
"fmod(x,y)\n\nReturn fmod(x, y), according to platform C." "fmod(x, y)\n\nReturn fmod(x, y), according to platform C."
" x % y may differ."); " x % y may differ.");
static PyObject * static PyObject *
@ -915,7 +917,7 @@ math_hypot(PyObject *self, PyObject *args)
} }
PyDoc_STRVAR(math_hypot_doc, PyDoc_STRVAR(math_hypot_doc,
"hypot(x,y)\n\nReturn the Euclidean distance, sqrt(x*x + y*y)."); "hypot(x, y)\n\nReturn the Euclidean distance, sqrt(x*x + y*y).");
/* pow can't use math_2, but needs its own wrapper: the problem is /* pow can't use math_2, but needs its own wrapper: the problem is
that an infinite result can arise either as a result of overflow that an infinite result can arise either as a result of overflow
@ -1002,7 +1004,7 @@ math_pow(PyObject *self, PyObject *args)
} }
PyDoc_STRVAR(math_pow_doc, PyDoc_STRVAR(math_pow_doc,
"pow(x,y)\n\nReturn x**y (x to the power of y)."); "pow(x, y)\n\nReturn x**y (x to the power of y).");
static const double degToRad = Py_MATH_PI / 180.0; static const double degToRad = Py_MATH_PI / 180.0;
static const double radToDeg = 180.0 / Py_MATH_PI; static const double radToDeg = 180.0 / Py_MATH_PI;
@ -1017,7 +1019,8 @@ math_degrees(PyObject *self, PyObject *arg)
} }
PyDoc_STRVAR(math_degrees_doc, PyDoc_STRVAR(math_degrees_doc,
"degrees(x) -> converts angle x from radians to degrees"); "degrees(x)\n\n\
Convert angle x from radians to degrees.");
static PyObject * static PyObject *
math_radians(PyObject *self, PyObject *arg) math_radians(PyObject *self, PyObject *arg)
@ -1029,7 +1032,8 @@ math_radians(PyObject *self, PyObject *arg)
} }
PyDoc_STRVAR(math_radians_doc, PyDoc_STRVAR(math_radians_doc,
"radians(x) -> converts angle x from degrees to radians"); "radians(x)\n\n\
Convert angle x from degrees to radians.");
static PyObject * static PyObject *
math_isnan(PyObject *self, PyObject *arg) math_isnan(PyObject *self, PyObject *arg)
@ -1041,8 +1045,8 @@ math_isnan(PyObject *self, PyObject *arg)
} }
PyDoc_STRVAR(math_isnan_doc, PyDoc_STRVAR(math_isnan_doc,
"isnan(x) -> bool\n\ "isnan(x) -> bool\n\n\
Checks if float x is not a number (NaN)"); Check if float x is not a number (NaN).");
static PyObject * static PyObject *
math_isinf(PyObject *self, PyObject *arg) math_isinf(PyObject *self, PyObject *arg)
@ -1054,8 +1058,8 @@ math_isinf(PyObject *self, PyObject *arg)
} }
PyDoc_STRVAR(math_isinf_doc, PyDoc_STRVAR(math_isinf_doc,
"isinf(x) -> bool\n\ "isinf(x) -> bool\n\n\
Checks if float x is infinite (positive or negative)"); Check if float x is infinite (positive or negative).");
static PyMethodDef math_methods[] = { static PyMethodDef math_methods[] = {
{"acos", math_acos, METH_O, math_acos_doc}, {"acos", math_acos, METH_O, math_acos_doc},

View File

@ -7,7 +7,7 @@ PyDoc_STRVAR(operator_doc,
This module exports a set of functions implemented in C corresponding\n\ This module exports a set of functions implemented in C corresponding\n\
to the intrinsic operators of Python. For example, operator.add(x, y)\n\ to the intrinsic operators of Python. For example, operator.add(x, y)\n\
is equivalent to the expression x+y. The function names are those\n\ is equivalent to the expression x+y. The function names are those\n\
used for special class methods; variants without leading and trailing\n\ used for special methods; variants without leading and trailing\n\
'__' are also provided for convenience."); '__' are also provided for convenience.");
#define spam1(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a1) { \ #define spam1(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a1) { \
@ -258,26 +258,26 @@ spam2o(not_,__not__, "not_(a) -- Same as not a.")
spam2(and_,__and__, "and_(a, b) -- Same as a & b.") spam2(and_,__and__, "and_(a, b) -- Same as a & b.")
spam2(xor,__xor__, "xor(a, b) -- Same as a ^ b.") spam2(xor,__xor__, "xor(a, b) -- Same as a ^ b.")
spam2(or_,__or__, "or_(a, b) -- Same as a | b.") spam2(or_,__or__, "or_(a, b) -- Same as a | b.")
spam2(iadd,__iadd__, "iadd(a, b) -- Same as a += b.") spam2(iadd,__iadd__, "a = iadd(a, b) -- Same as a += b.")
spam2(isub,__isub__, "isub(a, b) -- Same as a -= b.") spam2(isub,__isub__, "a = isub(a, b) -- Same as a -= b.")
spam2(imul,__imul__, "imul(a, b) -- Same as a *= b.") spam2(imul,__imul__, "a = imul(a, b) -- Same as a *= b.")
spam2(idiv,__idiv__, "idiv(a, b) -- Same as a /= b when __future__.division is not in effect.") spam2(idiv,__idiv__, "a = idiv(a, b) -- Same as a /= b when __future__.division is not in effect.")
spam2(ifloordiv,__ifloordiv__, "ifloordiv(a, b) -- Same as a //= b.") spam2(ifloordiv,__ifloordiv__, "a = ifloordiv(a, b) -- Same as a //= b.")
spam2(itruediv,__itruediv__, "itruediv(a, b) -- Same as a /= b when __future__.division is in effect.") spam2(itruediv,__itruediv__, "a = itruediv(a, b) -- Same as a /= b when __future__.division is in effect.")
spam2(imod,__imod__, "imod(a, b) -- Same as a %= b.") spam2(imod,__imod__, "a = imod(a, b) -- Same as a %= b.")
spam2(ilshift,__ilshift__, "ilshift(a, b) -- Same as a <<= b.") spam2(ilshift,__ilshift__, "a = ilshift(a, b) -- Same as a <<= b.")
spam2(irshift,__irshift__, "irshift(a, b) -- Same as a >>= b.") spam2(irshift,__irshift__, "a = irshift(a, b) -- Same as a >>= b.")
spam2(iand,__iand__, "iand(a, b) -- Same as a &= b.") spam2(iand,__iand__, "a = iand(a, b) -- Same as a &= b.")
spam2(ixor,__ixor__, "ixor(a, b) -- Same as a ^= b.") spam2(ixor,__ixor__, "a = ixor(a, b) -- Same as a ^= b.")
spam2(ior,__ior__, "ior(a, b) -- Same as a |= b.") spam2(ior,__ior__, "a = ior(a, b) -- Same as a |= b.")
spam2(concat,__concat__, spam2(concat,__concat__,
"concat(a, b) -- Same as a + b, for a and b sequences.") "concat(a, b) -- Same as a + b, for a and b sequences.")
spam2(repeat,__repeat__, spam2(repeat,__repeat__,
"repeat(a, b) -- Return a * b, where a is a sequence, and b is an integer.") "repeat(a, b) -- Return a * b, where a is a sequence, and b is an integer.")
spam2(iconcat,__iconcat__, spam2(iconcat,__iconcat__,
"iconcat(a, b) -- Same as a += b, for a and b sequences.") "a = iconcat(a, b) -- Same as a += b, for a and b sequences.")
spam2(irepeat,__irepeat__, spam2(irepeat,__irepeat__,
"irepeat(a, b) -- Same as a *= b, where a is a sequence, and b is an integer.") "a = irepeat(a, b) -- Same as a *= b, where a is a sequence, and b is an integer.")
spam2(getitem,__getitem__, spam2(getitem,__getitem__,
"getitem(a, b) -- Same as a[b].") "getitem(a, b) -- Same as a[b].")
spam2(setitem,__setitem__, spam2(setitem,__setitem__,
@ -285,7 +285,7 @@ spam2(setitem,__setitem__,
spam2(delitem,__delitem__, spam2(delitem,__delitem__,
"delitem(a, b) -- Same as del a[b].") "delitem(a, b) -- Same as del a[b].")
spam2(pow,__pow__, "pow(a, b) -- Same as a ** b.") spam2(pow,__pow__, "pow(a, b) -- Same as a ** b.")
spam2(ipow,__ipow__, "ipow(a, b) -- Same as a **= b.") spam2(ipow,__ipow__, "a = ipow(a, b) -- Same as a **= b.")
spam2(getslice,__getslice__, spam2(getslice,__getslice__,
"getslice(a, b, c) -- Same as a[b:c].") "getslice(a, b, c) -- Same as a[b:c].")
spam2(setslice,__setslice__, spam2(setslice,__setslice__,