diff options
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/ast.rst | 2 | ||||
-rw-r--r-- | Doc/library/ctypes.rst | 50 | ||||
-rw-r--r-- | Doc/library/numbers.rst | 8 | ||||
-rw-r--r-- | Doc/library/stdtypes.rst | 21 |
4 files changed, 39 insertions, 42 deletions
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 70840da..3c2f8d2 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -135,7 +135,7 @@ and classes for traversing abstract syntax trees: from untrusted sources without the need to parse the values oneself. -.. function:: get_docstring(node, clean=True): +.. function:: get_docstring(node, clean=True) Return the docstring of the given *node* (which must be a :class:`FunctionDef`, :class:`ClassDef` or :class:`Module` node), or ``None`` diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 61c1e61..51d340c 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -1395,11 +1395,6 @@ GetLastError() and SetLastError() Windows api functions; to request and change the ctypes private copy of the windows error code. -.. versionchanged:: 2.6 - -The `use_errno` and `use_last_error` parameters were added in Python -2.6. - .. data:: RTLD_GLOBAL :noindex: @@ -1561,22 +1556,23 @@ They are instances of a private class: Assign a Python function or another callable to this attribute. The callable will be called with three or more arguments: + .. function:: callable(result, func, arguments) + :noindex: -.. function:: callable(result, func, arguments) - :noindex: + ``result`` is what the foreign function returns, as specified + by the :attr:`restype` attribute. - ``result`` is what the foreign function returns, as specified by the - :attr:`restype` attribute. + ``func`` is the foreign function object itself, this allows + to reuse the same callable object to check or post process + the results of several functions. - ``func`` is the foreign function object itself, this allows to reuse the same - callable object to check or post process the results of several functions. + ``arguments`` is a tuple containing the parameters originally + passed to the function call, this allows to specialize the + behavior on the arguments used. - ``arguments`` is a tuple containing the parameters originally passed to the - function call, this allows to specialize the behavior on the arguments used. - - The object that this function returns will be returned from the foreign - function call, but it can also check the result value and raise an exception - if the foreign function call failed. + The object that this function returns will be returned from the + foreign function call, but it can also check the result value + and raise an exception if the foreign function call failed. .. exception:: ArgumentError() @@ -1605,10 +1601,6 @@ type and the argument types of the function. variable is exchanged with the real `errno` value bafore and after the call; `use_last_error` does the same for the Windows error code. - .. versionchanged:: 2.6 - The optional `use_errno` and `use_last_error` parameters were - added. - .. function:: WINFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) @@ -1786,11 +1778,19 @@ Utility functions ctypes type or instance. -.. function:: byref(obj) +.. function:: byref(obj[, offset]) + + Returns a light-weight pointer to ``obj``, which must be an + instance of a ctypes type. ``offset`` defaults to zero, it must be + an integer which is added to the internal pointer value. + + ``byref(obj, offset)`` corresponds to this C code:: + + (((char *)&obj) + offset) - Returns a light-weight pointer to ``obj``, which must be an instance of a ctypes - type. The returned object can only be used as a foreign function call parameter. - It behaves similar to ``pointer(obj)``, but the construction is a lot faster. + The returned object can only be used as a foreign function call + parameter. It behaves similar to ``pointer(obj)``, but the + construction is a lot faster. .. function:: cast(obj, type) diff --git a/Doc/library/numbers.rst b/Doc/library/numbers.rst index c74bd47..ef4bd80 100644 --- a/Doc/library/numbers.rst +++ b/Doc/library/numbers.rst @@ -71,10 +71,10 @@ The numeric tower .. class:: Integral - Subtypes :class:`Rational` and adds a conversion to :class:`long`, the - 3-argument form of :func:`pow`, and the bit-string operations: ``<<``, - ``>>``, ``&``, ``^``, ``|``, ``~``. Provides defaults for :func:`float`, - :attr:`Rational.numerator`, and :attr:`Rational.denominator`. + Subtypes :class:`Rational` and adds a conversion to :class:`int`. + Provides defaults for :func:`float`, :attr:`Rational.numerator`, and + :attr:`Rational.denominator`, and bit-string operations: ``<<``, + ``>>``, ``&``, ``^``, ``|``, ``~``. Notes for type implementors diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 0dd520e..4cb14e7 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1517,21 +1517,15 @@ The constructors for both classes work the same: Return a new set with elements from both sets. - .. versionchanged:: 2.6 - Accepts multiple input iterables. - .. method:: intersection(other, ...) set & other & ... Return a new set with elements common to both sets. - .. versionchanged:: 2.6 - Accepts multiple input iterables. + .. method:: difference(other, ...) + set - other - ... - .. method:: difference(other) - set - other - - Return a new set with elements in the set that are not in *other*. + Return a new set with elements in the set that are not in the others. .. method:: symmetric_difference(other) set ^ other @@ -1595,10 +1589,13 @@ The constructors for both classes work the same: .. versionchanged:: 2.6 Accepts multiple input iterables. - .. method:: difference_update(other) - set -= other + .. method:: difference_update(other, ...) + set -= other | ... + + Update the set, removing elements found in others. - Update the set, removing elements found in *other*. + .. versionchanged:: 2.6 + Accepts multiple input iterables. .. method:: symmetric_difference_update(other) set ^= other |