mirror of https://github.com/python/cpython
Consistency check for versionadded/changed directives.
This commit is contained in:
parent
9e25701e87
commit
67b21b7547
|
@ -305,13 +305,14 @@ Other objects
|
||||||
the conversion has failed. When the conversion fails, the *converter* function
|
the conversion has failed. When the conversion fails, the *converter* function
|
||||||
should raise an exception and leave the content of *address* unmodified.
|
should raise an exception and leave the content of *address* unmodified.
|
||||||
|
|
||||||
If the *converter* returns Py_CLEANUP_SUPPORTED, it may get called a second time
|
If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a
|
||||||
if the argument parsing eventually fails, giving the converter a chance to release
|
second time if the argument parsing eventually fails, giving the converter a
|
||||||
any memory that it had already allocated. In this second call, the *object* parameter
|
chance to release any memory that it had already allocated. In this second
|
||||||
will be NULL; *address* will have the same value as in the original call.
|
call, the *object* parameter will be NULL; *address* will have the same value
|
||||||
|
as in the original call.
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
Py_CLEANUP_SUPPORTED was added.
|
``Py_CLEANUP_SUPPORTED`` was added.
|
||||||
|
|
||||||
``(items)`` (:class:`tuple`) [*matching-items*]
|
``(items)`` (:class:`tuple`) [*matching-items*]
|
||||||
The object must be a Python sequence whose length is the number of format units
|
The object must be a Python sequence whose length is the number of format units
|
||||||
|
|
|
@ -181,6 +181,7 @@ All integers are implemented as "long" integer objects of arbitrary size.
|
||||||
cannot be represented as a :ctype:`long long`, an
|
cannot be represented as a :ctype:`long long`, an
|
||||||
:exc:`OverflowError` is raised and ``-1`` is returned.
|
:exc:`OverflowError` is raised and ``-1`` is returned.
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *pylong)
|
.. cfunction:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *pylong)
|
||||||
|
|
||||||
.. index::
|
.. index::
|
||||||
|
@ -192,8 +193,8 @@ All integers are implemented as "long" integer objects of arbitrary size.
|
||||||
returned.
|
returned.
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
A negative *pylong* now raises :exc:`OverflowError`, not
|
A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`.
|
||||||
:exc:`TypeError`.
|
|
||||||
|
|
||||||
.. cfunction:: unsigned long PyLong_AsUnsignedLongMask(PyObject *io)
|
.. cfunction:: unsigned long PyLong_AsUnsignedLongMask(PyObject *io)
|
||||||
|
|
||||||
|
|
|
@ -127,6 +127,7 @@ accessible to C code. They all work with the current interpreter thread's
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. _processcontrol:
|
.. _processcontrol:
|
||||||
|
|
||||||
Process Control
|
Process Control
|
||||||
|
|
|
@ -320,8 +320,7 @@ APIs:
|
||||||
when :const:`HAVE_LONG_LONG` is defined.
|
when :const:`HAVE_LONG_LONG` is defined.
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
Support for `"%lld"` and `"%llu"` added.
|
Support for ``"%lld"`` and ``"%llu"`` added.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs)
|
.. cfunction:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs)
|
||||||
|
@ -387,6 +386,7 @@ used, passsing :func:`PyUnicode_FSConverter` as the conversion function:
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
|
|
||||||
|
|
||||||
To decode file names during argument parsing, the ``"O&"`` converter should be
|
To decode file names during argument parsing, the ``"O&"`` converter should be
|
||||||
used, passsing :func:`PyUnicode_FSDecoder` as the conversion function:
|
used, passsing :func:`PyUnicode_FSDecoder` as the conversion function:
|
||||||
|
|
||||||
|
@ -399,6 +399,7 @@ used, passsing :func:`PyUnicode_FSDecoder` as the conversion function:
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. cfunction:: PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
|
.. cfunction:: PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
|
||||||
|
|
||||||
Decode a null-terminated string using :cdata:`Py_FileSystemDefaultEncoding`
|
Decode a null-terminated string using :cdata:`Py_FileSystemDefaultEncoding`
|
||||||
|
|
|
@ -206,6 +206,6 @@ distribution::
|
||||||
:option:`-o` is a shortcut for :option:`--manifest-only`.
|
:option:`-o` is a shortcut for :option:`--manifest-only`.
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
An existing generated :file:`MANIFEST` will be regenerated without
|
An existing generated :file:`MANIFEST` will be regenerated without
|
||||||
:command:`sdist` comparing its modification time to the one of
|
:command:`sdist` comparing its modification time to the one of
|
||||||
:file:`MANIFEST.in` or :file:`setup.py`.
|
:file:`MANIFEST.in` or :file:`setup.py`.
|
||||||
|
|
|
@ -60,7 +60,7 @@ The :mod:`binascii` module defines the following functions:
|
||||||
*header* is present and true, underscores will be decoded as spaces.
|
*header* is present and true, underscores will be decoded as spaces.
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
accept only bytestring or bytearray object as input.
|
Accept only bytestring or bytearray objects as input.
|
||||||
|
|
||||||
|
|
||||||
.. function:: b2a_qp(data, quotetabs=False, istext=True, header=False)
|
.. function:: b2a_qp(data, quotetabs=False, istext=True, header=False)
|
||||||
|
@ -92,7 +92,7 @@ The :mod:`binascii` module defines the following functions:
|
||||||
in which case the :exc:`Incomplete` exception is raised.
|
in which case the :exc:`Incomplete` exception is raised.
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
accept only bytestring or bytearray object as input.
|
Accept only bytestring or bytearray objects as input.
|
||||||
|
|
||||||
|
|
||||||
.. function:: rlecode_hqx(data)
|
.. function:: rlecode_hqx(data)
|
||||||
|
@ -151,7 +151,7 @@ The :mod:`binascii` module defines the following functions:
|
||||||
:exc:`TypeError` is raised.
|
:exc:`TypeError` is raised.
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
accept only bytestring or bytearray object as input.
|
Accept only bytestring or bytearray objects as input.
|
||||||
|
|
||||||
|
|
||||||
.. exception:: Error
|
.. exception:: Error
|
||||||
|
|
|
@ -266,6 +266,7 @@ counts, but the output will exclude results with counts of zero or less.
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. method:: extend(iterable)
|
.. method:: extend(iterable)
|
||||||
|
|
||||||
Extend the right side of the deque by appending elements from the iterable
|
Extend the right side of the deque by appending elements from the iterable
|
||||||
|
@ -296,12 +297,14 @@ counts, but the output will exclude results with counts of zero or less.
|
||||||
Removed the first occurrence of *value*. If not found, raises a
|
Removed the first occurrence of *value*. If not found, raises a
|
||||||
:exc:`ValueError`.
|
:exc:`ValueError`.
|
||||||
|
|
||||||
|
|
||||||
.. method:: reverse()
|
.. method:: reverse()
|
||||||
|
|
||||||
Reverse the elements of the deque in-place and then return ``None``.
|
Reverse the elements of the deque in-place and then return ``None``.
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. method:: rotate(n)
|
.. method:: rotate(n)
|
||||||
|
|
||||||
Rotate the deque *n* steps to the right. If *n* is negative, rotate to
|
Rotate the deque *n* steps to the right. If *n* is negative, rotate to
|
||||||
|
@ -576,7 +579,7 @@ they add the ability to access fields by name instead of position index.
|
||||||
lightweight and require no more memory than regular tuples.
|
lightweight and require no more memory than regular tuples.
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
added support for *rename*.
|
Added support for *rename*.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|
|
@ -360,6 +360,7 @@ RawConfigParser Objects
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. method:: RawConfigParser.read_dict(dictionary, source='<dict>')
|
.. method:: RawConfigParser.read_dict(dictionary, source='<dict>')
|
||||||
|
|
||||||
Load configuration from a dictionary. Keys are section names, values are
|
Load configuration from a dictionary. Keys are section names, values are
|
||||||
|
@ -372,6 +373,7 @@ RawConfigParser Objects
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. method:: RawConfigParser.get(section, option)
|
.. method:: RawConfigParser.get(section, option)
|
||||||
|
|
||||||
Get an *option* value for the named *section*.
|
Get an *option* value for the named *section*.
|
||||||
|
@ -455,11 +457,13 @@ RawConfigParser Objects
|
||||||
Note that when reading configuration files, whitespace around the
|
Note that when reading configuration files, whitespace around the
|
||||||
option names are stripped before :meth:`optionxform` is called.
|
option names are stripped before :meth:`optionxform` is called.
|
||||||
|
|
||||||
|
|
||||||
.. method:: RawConfigParser.readfp(fp, filename=None)
|
.. method:: RawConfigParser.readfp(fp, filename=None)
|
||||||
|
|
||||||
.. deprecated:: 3.2
|
.. deprecated:: 3.2
|
||||||
Please use :meth:`read_file` instead.
|
Please use :meth:`read_file` instead.
|
||||||
|
|
||||||
|
|
||||||
.. _configparser-objects:
|
.. _configparser-objects:
|
||||||
|
|
||||||
ConfigParser Objects
|
ConfigParser Objects
|
||||||
|
|
|
@ -302,12 +302,11 @@ In addition to the operations listed above :class:`timedelta` objects support
|
||||||
certain additions and subtractions with :class:`date` and :class:`datetime`
|
certain additions and subtractions with :class:`date` and :class:`datetime`
|
||||||
objects (see below).
|
objects (see below).
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionchanged:: 3.2
|
||||||
Floor division and true division of a :class:`timedelta` object by
|
Floor division and true division of a :class:`timedelta` object by another
|
||||||
another :class:`timedelta` object are now supported, as are
|
:class:`timedelta` object are now supported, as are remainder operations and
|
||||||
remainder operations and the :func:`divmod` function. True
|
the :func:`divmod` function. True division and multiplication of a
|
||||||
division and multiplication of a :class:`timedelta` object by
|
:class:`timedelta` object by a :class:`float` object are now supported.
|
||||||
a :class:`float` object are now supported.
|
|
||||||
|
|
||||||
|
|
||||||
Comparisons of :class:`timedelta` objects are supported with the
|
Comparisons of :class:`timedelta` objects are supported with the
|
||||||
|
@ -1779,9 +1778,7 @@ Notes:
|
||||||
For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``,
|
For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``,
|
||||||
``%z`` is replaced with the string ``'-0330'``.
|
``%z`` is replaced with the string ``'-0330'``.
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionchanged:: 3.2
|
||||||
|
When the ``%z`` directive is provided to the :meth:`strptime` method, an
|
||||||
When the ``%z`` directive is provided to the :meth:`strptime`
|
aware :class:`datetime` object will be produced. The ``tzinfo`` of the
|
||||||
method, an aware :class:`datetime` object will be produced. The
|
result will be set to a :class:`timezone` instance.
|
||||||
``tzinfo`` of the result will be set to a :class:`timezone`
|
|
||||||
instance.
|
|
||||||
|
|
|
@ -354,7 +354,8 @@ Decimal objects
|
||||||
Once constructed, :class:`Decimal` objects are immutable.
|
Once constructed, :class:`Decimal` objects are immutable.
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
The argument to the constructor is now permitted to be a :class:`float` instance.
|
The argument to the constructor is now permitted to be a :class:`float`
|
||||||
|
instance.
|
||||||
|
|
||||||
Decimal floating point objects share many properties with the other built-in
|
Decimal floating point objects share many properties with the other built-in
|
||||||
numeric types such as :class:`float` and :class:`int`. All of the usual math
|
numeric types such as :class:`float` and :class:`int`. All of the usual math
|
||||||
|
@ -372,8 +373,8 @@ Decimal objects
|
||||||
when doing equality comparisons between numbers of different types.
|
when doing equality comparisons between numbers of different types.
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
Mixed-type comparisons between :class:`Decimal` instances and
|
Mixed-type comparisons between :class:`Decimal` instances and other
|
||||||
other numeric types are now fully supported.
|
numeric types are now fully supported.
|
||||||
|
|
||||||
In addition to the standard numeric properties, decimal floating point
|
In addition to the standard numeric properties, decimal floating point
|
||||||
objects also have a number of specialized methods:
|
objects also have a number of specialized methods:
|
||||||
|
@ -1007,7 +1008,6 @@ In addition to the three supplied contexts, new contexts can be created with the
|
||||||
value for subnormal results. When underflow occurs, the exponent is set
|
value for subnormal results. When underflow occurs, the exponent is set
|
||||||
to :const:`Etiny`.
|
to :const:`Etiny`.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Etop()
|
.. method:: Etop()
|
||||||
|
|
||||||
Returns a value equal to ``Emax - prec + 1``.
|
Returns a value equal to ``Emax - prec + 1``.
|
||||||
|
|
|
@ -38,26 +38,26 @@ The :mod:`dis` module defines the following functions and constants:
|
||||||
|
|
||||||
.. function:: code_info(x=None)
|
.. function:: code_info(x=None)
|
||||||
|
|
||||||
Return a formatted multi-line string with detailed code object
|
Return a formatted multi-line string with detailed code object information
|
||||||
information for the supplied function, method, source code string
|
for the supplied function, method, source code string or code object.
|
||||||
or code object.
|
|
||||||
|
|
||||||
Note that the exact contents of code info strings are highly
|
Note that the exact contents of code info strings are highly implementation
|
||||||
implementation dependent and they may change arbitrarily across
|
dependent and they may change arbitrarily across Python VMs or Python
|
||||||
Python VMs or Python releases.
|
releases.
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. function:: dis(x=None)
|
.. function:: dis(x=None)
|
||||||
|
|
||||||
Disassemble the *x* object. *x* can denote either a module, a
|
Disassemble the *x* object. *x* can denote either a module, a class, a
|
||||||
class, a method, a function, a code object, a string of source code or a
|
method, a function, a code object, a string of source code or a byte sequence
|
||||||
byte sequence of raw bytecode. For a module, it disassembles all
|
of raw bytecode. For a module, it disassembles all functions. For a class,
|
||||||
functions. For a class, it disassembles all methods. For a code object
|
it disassembles all methods. For a code object or sequence of raw bytecode,
|
||||||
or sequence of raw bytecode, it prints one line per bytecode instruction.
|
it prints one line per bytecode instruction. Strings are first compiled to
|
||||||
Strings are first compiled to code objects with the :func:`compile`
|
code objects with the :func:`compile` built-in function before being
|
||||||
built-in function before being disassembled. If no object is provided,
|
disassembled. If no object is provided, this function disassembles the last
|
||||||
this function disassembles the last traceback.
|
traceback.
|
||||||
|
|
||||||
|
|
||||||
.. function:: distb(tb=None)
|
.. function:: distb(tb=None)
|
||||||
|
|
|
@ -574,8 +574,8 @@ doctest decides whether actual output matches an example's expected output:
|
||||||
changed in Python 2.4 to say "does not" instead of "doesn't".
|
changed in Python 2.4 to say "does not" instead of "doesn't".
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
:const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information
|
:const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating
|
||||||
relating to the module containing the exception under test
|
to the module containing the exception under test.
|
||||||
|
|
||||||
|
|
||||||
.. data:: SKIP
|
.. data:: SKIP
|
||||||
|
|
|
@ -181,7 +181,6 @@ are always available. They are listed here in alphabetical order.
|
||||||
character. This is to facilitate detection of incomplete and complete
|
character. This is to facilitate detection of incomplete and complete
|
||||||
statements in the :mod:`code` module.
|
statements in the :mod:`code` module.
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode
|
Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode
|
||||||
does not have to end in a newline anymore.
|
does not have to end in a newline anymore.
|
||||||
|
@ -939,8 +938,8 @@ are always available. They are listed here in alphabetical order.
|
||||||
[]
|
[]
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
Testing integers for membership takes constant time instead of
|
Testing integers for membership takes constant time instead of iterating
|
||||||
iterating through all items.
|
through all items.
|
||||||
|
|
||||||
|
|
||||||
.. function:: repr(object)
|
.. function:: repr(object)
|
||||||
|
|
|
@ -36,6 +36,7 @@ The :mod:`functools` module defines the following functions:
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. decorator:: lru_cache(maxsize)
|
.. decorator:: lru_cache(maxsize)
|
||||||
|
|
||||||
Decorator to wrap a function with a memoizing callable that saves up to the
|
Decorator to wrap a function with a memoizing callable that saves up to the
|
||||||
|
@ -67,6 +68,7 @@ The :mod:`functools` module defines the following functions:
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. decorator:: total_ordering
|
.. decorator:: total_ordering
|
||||||
|
|
||||||
Given a class defining one or more rich comparison ordering methods, this
|
Given a class defining one or more rich comparison ordering methods, this
|
||||||
|
@ -90,6 +92,7 @@ The :mod:`functools` module defines the following functions:
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. function:: partial(func, *args, **keywords)
|
.. function:: partial(func, *args, **keywords)
|
||||||
|
|
||||||
Return a new :class:`partial` object which when called will behave like *func*
|
Return a new :class:`partial` object which when called will behave like *func*
|
||||||
|
|
|
@ -179,12 +179,12 @@ value but should not rebind it):
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
If this list is non-empty at interpreter shutdown, a warning message
|
If this list is non-empty at interpreter shutdown, a warning message
|
||||||
gets printed:
|
gets printed.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
gc: 2 uncollectable objects at shutdown:
|
gc: 2 uncollectable objects at shutdown:
|
||||||
Use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them.
|
Use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them.
|
||||||
|
|
||||||
The following constants are provided for use with :func:`set_debug`:
|
The following constants are provided for use with :func:`set_debug`:
|
||||||
|
|
||||||
|
|
|
@ -114,10 +114,9 @@ A hash object has the following methods:
|
||||||
equivalent to ``m.update(a+b)``.
|
equivalent to ``m.update(a+b)``.
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
|
The Python GIL is released to allow other threads to run while hash
|
||||||
The Python GIL is released to allow other threads to run while
|
updates on data larger than 2048 bytes is taking place when using hash
|
||||||
hash updates on data larger than 2048 bytes is taking place when
|
algorithms supplied by OpenSSL.
|
||||||
using hash algorithms supplied by OpenSSL.
|
|
||||||
|
|
||||||
|
|
||||||
.. method:: hash.digest()
|
.. method:: hash.digest()
|
||||||
|
|
|
@ -394,6 +394,7 @@ HTTPConnection Objects
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
|
|
||||||
|
|
||||||
.. method:: HTTPConnection.set_tunnel(host, port=None, headers=None)
|
.. method:: HTTPConnection.set_tunnel(host, port=None, headers=None)
|
||||||
|
|
||||||
Set the host and the port for HTTP Connect Tunnelling. Normally used when it
|
Set the host and the port for HTTP Connect Tunnelling. Normally used when it
|
||||||
|
@ -404,6 +405,7 @@ HTTPConnection Objects
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. method:: HTTPConnection.connect()
|
.. method:: HTTPConnection.connect()
|
||||||
|
|
||||||
Connect to the server specified when the object was created.
|
Connect to the server specified when the object was created.
|
||||||
|
|
|
@ -301,7 +301,7 @@ I/O Base Classes
|
||||||
Return the new absolute position.
|
Return the new absolute position.
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
The ``SEEK_*`` constants
|
The ``SEEK_*`` constants.
|
||||||
|
|
||||||
.. method:: seekable()
|
.. method:: seekable()
|
||||||
|
|
||||||
|
|
|
@ -207,6 +207,7 @@ loops that truncate the stream.
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
|
|
||||||
|
|
||||||
.. function:: compress(data, selectors)
|
.. function:: compress(data, selectors)
|
||||||
|
|
||||||
Make an iterator that filters elements from *data* returning only those that
|
Make an iterator that filters elements from *data* returning only those that
|
||||||
|
@ -240,7 +241,7 @@ loops that truncate the stream.
|
||||||
for i in count())``.
|
for i in count())``.
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
added *step* argument and allowed non-integer arguments.
|
Added *step* argument and allowed non-integer arguments.
|
||||||
|
|
||||||
.. function:: cycle(iterable)
|
.. function:: cycle(iterable)
|
||||||
|
|
||||||
|
|
|
@ -440,8 +440,6 @@ import mechanisms. Thus, you could use either `handlers.WatchedFileHandler`
|
||||||
class defined in package `mypackage` and module `mymodule`, where `mypackage`
|
class defined in package `mypackage` and module `mymodule`, where `mypackage`
|
||||||
is available on the Python import path).
|
is available on the Python import path).
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
|
||||||
|
|
||||||
In Python 3.2, a new means of configuring logging has been introduced, using
|
In Python 3.2, a new means of configuring logging has been introduced, using
|
||||||
dictionaries to hold configuration information. This provides a superset of the
|
dictionaries to hold configuration information. This provides a superset of the
|
||||||
functionality of the config-file-based approach outlined above, and is the
|
functionality of the config-file-based approach outlined above, and is the
|
||||||
|
@ -521,9 +519,8 @@ libraries, then the logger name specified can be "orgname.foo" rather than
|
||||||
just "foo".
|
just "foo".
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
|
The :class:`NullHandler` class was not present in previous versions, but is
|
||||||
The :class:`NullHandler` class was not present in previous versions, but is now
|
now included, so that it need not be defined in library code.
|
||||||
included, so that it need not be defined in library code.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -953,6 +950,7 @@ instantiated directly, but always through the module-level function
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. method:: Logger.debug(msg, *args, **kwargs)
|
.. method:: Logger.debug(msg, *args, **kwargs)
|
||||||
|
|
||||||
Logs a message with level :const:`DEBUG` on this logger. The *msg* is the
|
Logs a message with level :const:`DEBUG` on this logger. The *msg* is the
|
||||||
|
@ -2586,9 +2584,8 @@ methods have the same signatures as their counterparts in :class:`Logger`, so
|
||||||
you can use the two types of instances interchangeably.
|
you can use the two types of instances interchangeably.
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
|
The :meth:`isEnabledFor` method was added to :class:`LoggerAdapter`. This
|
||||||
The :meth:`isEnabledFor` method was added to :class:`LoggerAdapter`. This method
|
method delegates to the underlying logger.
|
||||||
delegates to the underlying logger.
|
|
||||||
|
|
||||||
|
|
||||||
Thread Safety
|
Thread Safety
|
||||||
|
|
|
@ -67,23 +67,22 @@ Notes on the availability of these functions:
|
||||||
File Names, Command Line Arguments, and Environment Variables
|
File Names, Command Line Arguments, and Environment Variables
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
|
|
||||||
In Python, file names, command line arguments, and environment
|
In Python, file names, command line arguments, and environment variables are
|
||||||
variables are represented using the string type. On some systems,
|
represented using the string type. On some systems, decoding these strings to
|
||||||
decoding these strings to and from bytes is necessary before passing
|
and from bytes is necessary before passing them to the operating system. Python
|
||||||
them to the operating system. Python uses the file system encoding to
|
uses the file system encoding to perform this conversion (see
|
||||||
perform this conversion (see :func:`sys.getfilesystemencoding`).
|
:func:`sys.getfilesystemencoding`).
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
On some systems, conversion using the file system encoding may
|
On some systems, conversion using the file system encoding may fail. In this
|
||||||
fail. In this case, Python uses the ``surrogateescape`` encoding
|
case, Python uses the ``surrogateescape`` encoding error handler, which means
|
||||||
error handler, which means that undecodable bytes are replaced by a
|
that undecodable bytes are replaced by a Unicode character U+DCxx on
|
||||||
Unicode character U+DCxx on decoding, and these are again
|
decoding, and these are again translated to the original byte on encoding.
|
||||||
translated to the original byte on encoding.
|
|
||||||
|
|
||||||
|
|
||||||
The file system encoding must guarantee to successfully decode all
|
The file system encoding must guarantee to successfully decode all bytes
|
||||||
bytes below 128. If the file system encoding fails to provide this
|
below 128. If the file system encoding fails to provide this guarantee, API
|
||||||
guarantee, API functions may raise UnicodeErrors.
|
functions may raise UnicodeErrors.
|
||||||
|
|
||||||
|
|
||||||
.. _os-procinfo:
|
.. _os-procinfo:
|
||||||
|
@ -1744,7 +1743,8 @@ written in Python, such as a mail server's external command delivery program.
|
||||||
will be set to *sig*. The Windows version of :func:`kill` additionally takes
|
will be set to *sig*. The Windows version of :func:`kill` additionally takes
|
||||||
process handles to be killed.
|
process handles to be killed.
|
||||||
|
|
||||||
.. versionadded:: 3.2 Windows support
|
.. versionadded:: 3.2
|
||||||
|
Windows support.
|
||||||
|
|
||||||
|
|
||||||
.. function:: killpg(pgid, sig)
|
.. function:: killpg(pgid, sig)
|
||||||
|
|
|
@ -26,7 +26,8 @@ ordinary users of the :mod:`pickle` module probably won't find the
|
||||||
a short description. The value of *annotate* is used as a hint for
|
a short description. The value of *annotate* is used as a hint for
|
||||||
the column where annotation should start.
|
the column where annotation should start.
|
||||||
|
|
||||||
.. versionadded:: 3.2 the *annotate* argument.
|
.. versionadded:: 3.2
|
||||||
|
The *annotate* argument.
|
||||||
|
|
||||||
.. function:: genops(pickle)
|
.. function:: genops(pickle)
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,7 @@ The :mod:`runpy` module provides two functions:
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
Added ability to execute packages by looking for a ``__main__``
|
Added ability to execute packages by looking for a ``__main__`` submodule.
|
||||||
submodule
|
|
||||||
|
|
||||||
|
|
||||||
.. function:: run_path(file_path, init_globals=None, run_name=None)
|
.. function:: run_path(file_path, init_globals=None, run_name=None)
|
||||||
|
|
|
@ -229,11 +229,10 @@ Connection Objects
|
||||||
|
|
||||||
.. attribute:: Connection.in_transaction
|
.. attribute:: Connection.in_transaction
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
|
||||||
|
|
||||||
:const:`True` if a transaction is active (there are uncommitted changes),
|
:const:`True` if a transaction is active (there are uncommitted changes),
|
||||||
:const:`False` otherwise. Read-only attribute.
|
:const:`False` otherwise. Read-only attribute.
|
||||||
|
|
||||||
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
.. method:: Connection.cursor([cursorClass])
|
.. method:: Connection.cursor([cursorClass])
|
||||||
|
|
||||||
|
@ -241,7 +240,6 @@ Connection Objects
|
||||||
supplied, this must be a custom cursor class that extends
|
supplied, this must be a custom cursor class that extends
|
||||||
:class:`sqlite3.Cursor`.
|
:class:`sqlite3.Cursor`.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Connection.commit()
|
.. method:: Connection.commit()
|
||||||
|
|
||||||
This method commits the current transaction. If you don't call this method,
|
This method commits the current transaction. If you don't call this method,
|
||||||
|
@ -374,23 +372,23 @@ Connection Objects
|
||||||
|
|
||||||
.. method:: Connection.enable_load_extension(enabled)
|
.. method:: Connection.enable_load_extension(enabled)
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
|
||||||
|
|
||||||
This routine allows/disallows the SQLite engine to load SQLite extensions
|
This routine allows/disallows the SQLite engine to load SQLite extensions
|
||||||
from shared libraries. SQLite extensions can define new functions,
|
from shared libraries. SQLite extensions can define new functions,
|
||||||
aggregates or whole new virtual table implementations. One well-known
|
aggregates or whole new virtual table implementations. One well-known
|
||||||
extension is the fulltext-search extension distributed with SQLite.
|
extension is the fulltext-search extension distributed with SQLite.
|
||||||
|
|
||||||
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
.. literalinclude:: ../includes/sqlite3/load_extension.py
|
.. literalinclude:: ../includes/sqlite3/load_extension.py
|
||||||
|
|
||||||
.. method:: Connection.load_extension(path)
|
.. method:: Connection.load_extension(path)
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
|
||||||
|
|
||||||
This routine loads a SQLite extension from a shared library. You have to
|
This routine loads a SQLite extension from a shared library. You have to
|
||||||
enable extension loading with ``enable_load_extension`` before you can use
|
enable extension loading with ``enable_load_extension`` before you can use
|
||||||
this routine.
|
this routine.
|
||||||
|
|
||||||
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
.. attribute:: Connection.row_factory
|
.. attribute:: Connection.row_factory
|
||||||
|
|
||||||
You can change this attribute to a callable that accepts the cursor and the
|
You can change this attribute to a callable that accepts the cursor and the
|
||||||
|
|
|
@ -459,7 +459,7 @@ Additional Methods on Integer Types
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
|
|
||||||
.. method:: int.to_bytes(length, byteorder, \*, signed=False)
|
.. method:: int.to_bytes(length, byteorder, \*, signed=False)
|
||||||
|
|
||||||
Return an array of bytes representing an integer.
|
Return an array of bytes representing an integer.
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ Additional Methods on Integer Types
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
.. classmethod:: int.from_bytes(bytes, byteorder, \*, signed=False)
|
.. classmethod:: int.from_bytes(bytes, byteorder, \*, signed=False)
|
||||||
|
|
||||||
Return the integer represented by the given array of bytes.
|
Return the integer represented by the given array of bytes.
|
||||||
|
|
||||||
|
@ -996,7 +996,8 @@ functions based on regular expressions.
|
||||||
list of possible encodings, see section :ref:`standard-encodings`.
|
list of possible encodings, see section :ref:`standard-encodings`.
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
Added support for keyword arguments added.
|
Support for keyword arguments added.
|
||||||
|
|
||||||
|
|
||||||
.. method:: str.endswith(suffix[, start[, end]])
|
.. method:: str.endswith(suffix[, start[, end]])
|
||||||
|
|
||||||
|
|
|
@ -707,9 +707,9 @@ always available.
|
||||||
every virtual instruction, maximizing responsiveness as well as overhead.
|
every virtual instruction, maximizing responsiveness as well as overhead.
|
||||||
|
|
||||||
.. deprecated:: 3.2
|
.. deprecated:: 3.2
|
||||||
This function doesn't have an effect anymore, as the internal logic
|
This function doesn't have an effect anymore, as the internal logic for
|
||||||
for thread switching and asynchronous tasks has been rewritten.
|
thread switching and asynchronous tasks has been rewritten. Use
|
||||||
Use :func:`setswitchinterval` instead.
|
:func:`setswitchinterval` instead.
|
||||||
|
|
||||||
|
|
||||||
.. function:: setdefaultencoding(name)
|
.. function:: setdefaultencoding(name)
|
||||||
|
@ -958,7 +958,7 @@ always available.
|
||||||
and so on.
|
and so on.
|
||||||
|
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
Added named component attributes
|
Added named component attributes.
|
||||||
|
|
||||||
.. data:: warnoptions
|
.. data:: warnoptions
|
||||||
|
|
||||||
|
|
|
@ -166,6 +166,7 @@ This module also defines the following constant:
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
Detailed interfaces for the objects are documented below.
|
Detailed interfaces for the objects are documented below.
|
||||||
|
|
||||||
The design of this module is loosely based on Java's threading model. However,
|
The design of this module is loosely based on Java's threading model. However,
|
||||||
|
@ -386,6 +387,7 @@ All methods are executed atomically.
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
The *timeout* parameter is new.
|
The *timeout* parameter is new.
|
||||||
|
|
||||||
|
|
||||||
.. method:: Lock.release()
|
.. method:: Lock.release()
|
||||||
|
|
||||||
Release a lock.
|
Release a lock.
|
||||||
|
|
|
@ -210,7 +210,7 @@ For a list of all the command line options::
|
||||||
|
|
||||||
python -m unittest -h
|
python -m unittest -h
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
In earlier versions it was only possible to run individual test methods and
|
In earlier versions it was only possible to run individual test methods and
|
||||||
not modules or classes.
|
not modules or classes.
|
||||||
|
|
||||||
|
@ -861,8 +861,8 @@ Test cases
|
||||||
Supplying both *delta* and *places* raises a ``TypeError``.
|
Supplying both *delta* and *places* raises a ``TypeError``.
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
Objects that compare equal automatically fail.
|
Objects that compare equal automatically fail. Added the ``delta``
|
||||||
Added the ``delta`` keyword argument.
|
keyword argument.
|
||||||
|
|
||||||
.. deprecated:: 3.1
|
.. deprecated:: 3.1
|
||||||
:meth:`failIfAlmostEqual`; use :meth:`assertNotAlmostEqual`.
|
:meth:`failIfAlmostEqual`; use :meth:`assertNotAlmostEqual`.
|
||||||
|
@ -941,9 +941,9 @@ Test cases
|
||||||
If specified, *msg* will be used as the error message on failure.
|
If specified, *msg* will be used as the error message on failure.
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
|
|
||||||
.. deprecated:: 3.2
|
.. deprecated:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. method:: assertItemsEqual(actual, expected, msg=None)
|
.. method:: assertItemsEqual(actual, expected, msg=None)
|
||||||
|
|
||||||
Test that sequence *expected* contains the same elements as *actual*,
|
Test that sequence *expected* contains the same elements as *actual*,
|
||||||
|
@ -960,6 +960,7 @@ Test cases
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
|
||||||
.. method:: assertSetEqual(set1, set2, msg=None)
|
.. method:: assertSetEqual(set1, set2, msg=None)
|
||||||
|
|
||||||
Tests that two sets are equal. If not, an error message is constructed
|
Tests that two sets are equal. If not, an error message is constructed
|
||||||
|
@ -1683,14 +1684,16 @@ a
|
||||||
The default implementation appends the test to the instance's
|
The default implementation appends the test to the instance's
|
||||||
:attr:`unexpectedSuccesses` attribute.
|
:attr:`unexpectedSuccesses` attribute.
|
||||||
|
|
||||||
|
|
||||||
.. class:: TextTestResult(stream, descriptions, verbosity)
|
.. class:: TextTestResult(stream, descriptions, verbosity)
|
||||||
|
|
||||||
A concrete implementation of :class:`TestResult` used by the
|
A concrete implementation of :class:`TestResult` used by the
|
||||||
:class:`TextTestRunner`.
|
:class:`TextTestRunner`.
|
||||||
|
|
||||||
|
.. versionadded:: 3.2
|
||||||
|
This class was previously named ``_TextTestResult``. The old name still
|
||||||
|
exists as an alias but is deprecated.
|
||||||
|
|
||||||
.. versionadded:: 3.2
|
|
||||||
This class was previously named ``_TextTestResult``. The old name still
|
|
||||||
exists as an alias but is deprecated.
|
|
||||||
|
|
||||||
.. data:: defaultTestLoader
|
.. data:: defaultTestLoader
|
||||||
|
|
||||||
|
|
|
@ -349,7 +349,7 @@ The :mod:`urllib.parse` module defines the following functions:
|
||||||
parameters are sent the :func:`quote_plus` for encoding.
|
parameters are sent the :func:`quote_plus` for encoding.
|
||||||
|
|
||||||
.. versionchanged:: 3.2
|
.. versionchanged:: 3.2
|
||||||
query paramater supports bytes and string.
|
Query parameter supports bytes and string objects.
|
||||||
|
|
||||||
|
|
||||||
.. seealso::
|
.. seealso::
|
||||||
|
|
|
@ -309,13 +309,13 @@ Element Objects
|
||||||
|
|
||||||
.. method:: getchildren()
|
.. method:: getchildren()
|
||||||
|
|
||||||
.. deprecated:: 2.7
|
.. deprecated:: 3.2
|
||||||
Use ``list(elem)`` or iteration.
|
Use ``list(elem)`` or iteration.
|
||||||
|
|
||||||
|
|
||||||
.. method:: getiterator(tag=None)
|
.. method:: getiterator(tag=None)
|
||||||
|
|
||||||
.. deprecated:: 2.7
|
.. deprecated:: 3.2
|
||||||
Use method :meth:`Element.iter` instead.
|
Use method :meth:`Element.iter` instead.
|
||||||
|
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ ElementTree Objects
|
||||||
|
|
||||||
.. method:: getiterator(tag=None)
|
.. method:: getiterator(tag=None)
|
||||||
|
|
||||||
.. deprecated:: 2.7
|
.. deprecated:: 3.2
|
||||||
Use method :meth:`ElementTree.iter` instead.
|
Use method :meth:`ElementTree.iter` instead.
|
||||||
|
|
||||||
|
|
||||||
|
@ -589,7 +589,7 @@ XMLParser Objects
|
||||||
|
|
||||||
.. method:: doctype(name, pubid, system)
|
.. method:: doctype(name, pubid, system)
|
||||||
|
|
||||||
.. deprecated:: 2.7
|
.. deprecated:: 3.2
|
||||||
Define the :meth:`TreeBuilder.doctype` method on a custom TreeBuilder
|
Define the :meth:`TreeBuilder.doctype` method on a custom TreeBuilder
|
||||||
target.
|
target.
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,7 @@ The module defines the following items:
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
Support for file and file-like objects.
|
Support for file and file-like objects.
|
||||||
|
|
||||||
|
|
||||||
.. data:: ZIP_STORED
|
.. data:: ZIP_STORED
|
||||||
|
|
||||||
The numeric constant for an uncompressed archive member.
|
The numeric constant for an uncompressed archive member.
|
||||||
|
|
|
@ -95,7 +95,7 @@ zipimporter Objects
|
||||||
was imported. Raise :exc:`ZipImportError` if the module couldn't be
|
was imported. Raise :exc:`ZipImportError` if the module couldn't be
|
||||||
found.
|
found.
|
||||||
|
|
||||||
.. versionadded:: 3.1
|
.. versionadded:: 3.1
|
||||||
|
|
||||||
|
|
||||||
.. method:: get_source(fullname)
|
.. method:: get_source(fullname)
|
||||||
|
|
|
@ -115,6 +115,7 @@ source.
|
||||||
.. versionchanged:: 3.1
|
.. versionchanged:: 3.1
|
||||||
Supply the package name to run a ``__main__`` submodule.
|
Supply the package name to run a ``__main__`` submodule.
|
||||||
|
|
||||||
|
|
||||||
.. describe:: -
|
.. describe:: -
|
||||||
|
|
||||||
Read commands from standard input (:data:`sys.stdin`). If standard input is
|
Read commands from standard input (:data:`sys.stdin`). If standard input is
|
||||||
|
|
Loading…
Reference in New Issue