Consistency check for versionadded/changed directives.

This commit is contained in:
Georg Brandl 2010-08-17 15:07:14 +00:00
parent 9e25701e87
commit 67b21b7547
33 changed files with 129 additions and 114 deletions

View File

@ -305,13 +305,14 @@ Other objects
the conversion has failed. When the conversion fails, the *converter* function
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 argument parsing eventually fails, giving the converter a chance to release
any memory that it had already allocated. In this second call, the *object* parameter
will be NULL; *address* will have the same value as in the original call.
If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a
second time if the argument parsing eventually fails, giving the converter a
chance to release any memory that it had already allocated. In this second
call, the *object* parameter will be NULL; *address* will have the same value
as in the original call.
.. versionchanged:: 3.1
Py_CLEANUP_SUPPORTED was added.
``Py_CLEANUP_SUPPORTED`` was added.
``(items)`` (:class:`tuple`) [*matching-items*]
The object must be a Python sequence whose length is the number of format units

View File

@ -181,6 +181,7 @@ All integers are implemented as "long" integer objects of arbitrary size.
cannot be represented as a :ctype:`long long`, an
:exc:`OverflowError` is raised and ``-1`` is returned.
.. cfunction:: unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *pylong)
.. index::
@ -192,8 +193,8 @@ All integers are implemented as "long" integer objects of arbitrary size.
returned.
.. versionchanged:: 3.1
A negative *pylong* now raises :exc:`OverflowError`, not
:exc:`TypeError`.
A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`.
.. cfunction:: unsigned long PyLong_AsUnsignedLongMask(PyObject *io)

View File

@ -127,6 +127,7 @@ accessible to C code. They all work with the current interpreter thread's
.. versionadded:: 3.2
.. _processcontrol:
Process Control

View File

@ -320,8 +320,7 @@ APIs:
when :const:`HAVE_LONG_LONG` is defined.
.. 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)
@ -387,6 +386,7 @@ used, passsing :func:`PyUnicode_FSConverter` as the conversion function:
.. versionadded:: 3.1
To decode file names during argument parsing, the ``"O&"`` converter should be
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
.. cfunction:: PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
Decode a null-terminated string using :cdata:`Py_FileSystemDefaultEncoding`

View File

@ -206,6 +206,6 @@ distribution::
:option:`-o` is a shortcut for :option:`--manifest-only`.
.. versionchanged:: 3.1
An existing generated :file:`MANIFEST` will be regenerated without
:command:`sdist` comparing its modification time to the one of
:file:`MANIFEST.in` or :file:`setup.py`.
An existing generated :file:`MANIFEST` will be regenerated without
:command:`sdist` comparing its modification time to the one of
:file:`MANIFEST.in` or :file:`setup.py`.

View File

@ -60,7 +60,7 @@ The :mod:`binascii` module defines the following functions:
*header* is present and true, underscores will be decoded as spaces.
.. 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)
@ -92,7 +92,7 @@ The :mod:`binascii` module defines the following functions:
in which case the :exc:`Incomplete` exception is raised.
.. versionchanged:: 3.2
accept only bytestring or bytearray object as input.
Accept only bytestring or bytearray objects as input.
.. function:: rlecode_hqx(data)
@ -151,7 +151,7 @@ The :mod:`binascii` module defines the following functions:
:exc:`TypeError` is raised.
.. versionchanged:: 3.2
accept only bytestring or bytearray object as input.
Accept only bytestring or bytearray objects as input.
.. exception:: Error

View File

@ -266,6 +266,7 @@ counts, but the output will exclude results with counts of zero or less.
.. versionadded:: 3.2
.. method:: extend(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
:exc:`ValueError`.
.. method:: reverse()
Reverse the elements of the deque in-place and then return ``None``.
.. versionadded:: 3.2
.. method:: rotate(n)
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.
.. versionchanged:: 3.1
added support for *rename*.
Added support for *rename*.
Example:

View File

@ -360,6 +360,7 @@ RawConfigParser Objects
.. versionadded:: 3.2
.. method:: RawConfigParser.read_dict(dictionary, source='<dict>')
Load configuration from a dictionary. Keys are section names, values are
@ -372,6 +373,7 @@ RawConfigParser Objects
.. versionadded:: 3.2
.. method:: RawConfigParser.get(section, option)
Get an *option* value for the named *section*.
@ -455,11 +457,13 @@ RawConfigParser Objects
Note that when reading configuration files, whitespace around the
option names are stripped before :meth:`optionxform` is called.
.. method:: RawConfigParser.readfp(fp, filename=None)
.. deprecated:: 3.2
Please use :meth:`read_file` instead.
.. _configparser-objects:
ConfigParser Objects

View File

@ -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`
objects (see below).
.. versionadded:: 3.2
Floor division and true division of a :class:`timedelta` object by
another :class:`timedelta` object are now supported, as are
remainder operations and the :func:`divmod` function. True
division and multiplication of a :class:`timedelta` object by
a :class:`float` object are now supported.
.. versionchanged:: 3.2
Floor division and true division of a :class:`timedelta` object by another
:class:`timedelta` object are now supported, as are remainder operations and
the :func:`divmod` function. True division and multiplication of a
:class:`timedelta` object by a :class:`float` object are now supported.
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)``,
``%z`` is replaced with the string ``'-0330'``.
.. versionadded:: 3.2
When the ``%z`` directive is provided to the :meth:`strptime`
method, an aware :class:`datetime` object will be produced. The
``tzinfo`` of the result will be set to a :class:`timezone`
instance.
.. versionchanged:: 3.2
When the ``%z`` directive is provided to the :meth:`strptime` method, an
aware :class:`datetime` object will be produced. The ``tzinfo`` of the
result will be set to a :class:`timezone` instance.

View File

@ -354,7 +354,8 @@ Decimal objects
Once constructed, :class:`Decimal` objects are immutable.
.. 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
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.
.. versionchanged:: 3.2
Mixed-type comparisons between :class:`Decimal` instances and
other numeric types are now fully supported.
Mixed-type comparisons between :class:`Decimal` instances and other
numeric types are now fully supported.
In addition to the standard numeric properties, decimal floating point
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
to :const:`Etiny`.
.. method:: Etop()
Returns a value equal to ``Emax - prec + 1``.

View File

@ -38,26 +38,26 @@ The :mod:`dis` module defines the following functions and constants:
.. function:: code_info(x=None)
Return a formatted multi-line string with detailed code object
information for the supplied function, method, source code string
or code object.
Return a formatted multi-line string with detailed code object information
for the supplied function, method, source code string or code object.
Note that the exact contents of code info strings are highly
implementation dependent and they may change arbitrarily across
Python VMs or Python releases.
Note that the exact contents of code info strings are highly implementation
dependent and they may change arbitrarily across Python VMs or Python
releases.
.. versionadded:: 3.2
.. function:: dis(x=None)
Disassemble the *x* object. *x* can denote either a module, a
class, a method, a function, a code object, a string of source code or a
byte sequence of raw bytecode. For a module, it disassembles all
functions. For a class, it disassembles all methods. For a code object
or sequence of raw bytecode, it prints one line per bytecode instruction.
Strings are first compiled to code objects with the :func:`compile`
built-in function before being disassembled. If no object is provided,
this function disassembles the last traceback.
Disassemble the *x* object. *x* can denote either a module, a class, a
method, a function, a code object, a string of source code or a byte sequence
of raw bytecode. For a module, it disassembles all functions. For a class,
it disassembles all methods. For a code object or sequence of raw bytecode,
it prints one line per bytecode instruction. Strings are first compiled to
code objects with the :func:`compile` built-in function before being
disassembled. If no object is provided, this function disassembles the last
traceback.
.. function:: distb(tb=None)

View File

@ -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".
.. versionchanged:: 3.2
:const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information
relating to the module containing the exception under test
:const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating
to the module containing the exception under test.
.. data:: SKIP

View File

@ -181,7 +181,6 @@ are always available. They are listed here in alphabetical order.
character. This is to facilitate detection of incomplete and complete
statements in the :mod:`code` module.
.. versionchanged:: 3.2
Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode
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
Testing integers for membership takes constant time instead of
iterating through all items.
Testing integers for membership takes constant time instead of iterating
through all items.
.. function:: repr(object)

View File

@ -36,6 +36,7 @@ The :mod:`functools` module defines the following functions:
.. versionadded:: 3.2
.. decorator:: lru_cache(maxsize)
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
.. decorator:: total_ordering
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
.. function:: partial(func, *args, **keywords)
Return a new :class:`partial` object which when called will behave like *func*

View File

@ -179,12 +179,12 @@ value but should not rebind it):
.. versionchanged:: 3.2
If this list is non-empty at interpreter shutdown, a warning message
gets printed:
gets printed.
::
gc: 2 uncollectable objects at shutdown:
Use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them.
gc: 2 uncollectable objects at shutdown:
Use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them.
The following constants are provided for use with :func:`set_debug`:

View File

@ -114,10 +114,9 @@ A hash object has the following methods:
equivalent to ``m.update(a+b)``.
.. versionchanged:: 3.1
The Python GIL is released to allow other threads to run while
hash updates on data larger than 2048 bytes is taking place when
using hash algorithms supplied by OpenSSL.
The Python GIL is released to allow other threads to run while hash
updates on data larger than 2048 bytes is taking place when using hash
algorithms supplied by OpenSSL.
.. method:: hash.digest()

View File

@ -394,6 +394,7 @@ HTTPConnection Objects
.. versionadded:: 3.1
.. method:: HTTPConnection.set_tunnel(host, port=None, headers=None)
Set the host and the port for HTTP Connect Tunnelling. Normally used when it
@ -404,6 +405,7 @@ HTTPConnection Objects
.. versionadded:: 3.2
.. method:: HTTPConnection.connect()
Connect to the server specified when the object was created.

View File

@ -301,7 +301,7 @@ I/O Base Classes
Return the new absolute position.
.. versionadded:: 3.1
The ``SEEK_*`` constants
The ``SEEK_*`` constants.
.. method:: seekable()

View File

@ -207,6 +207,7 @@ loops that truncate the stream.
.. versionadded:: 3.1
.. function:: compress(data, selectors)
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())``.
.. versionchanged:: 3.1
added *step* argument and allowed non-integer arguments.
Added *step* argument and allowed non-integer arguments.
.. function:: cycle(iterable)

View File

@ -440,8 +440,6 @@ import mechanisms. Thus, you could use either `handlers.WatchedFileHandler`
class defined in package `mypackage` and module `mymodule`, where `mypackage`
is available on the Python import path).
.. versionchanged:: 3.2
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
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".
.. versionadded:: 3.1
The :class:`NullHandler` class was not present in previous versions, but is now
included, so that it need not be defined in library code.
The :class:`NullHandler` class was not present in previous versions, but is
now 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
.. method:: Logger.debug(msg, *args, **kwargs)
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.
.. versionchanged:: 3.2
The :meth:`isEnabledFor` method was added to :class:`LoggerAdapter`. This method
delegates to the underlying logger.
The :meth:`isEnabledFor` method was added to :class:`LoggerAdapter`. This
method delegates to the underlying logger.
Thread Safety

View File

@ -67,23 +67,22 @@ Notes on the availability of these functions:
File Names, Command Line Arguments, and Environment Variables
-------------------------------------------------------------
In Python, file names, command line arguments, and environment
variables are represented using the string type. On some systems,
decoding these strings to and from bytes is necessary before passing
them to the operating system. Python uses the file system encoding to
perform this conversion (see :func:`sys.getfilesystemencoding`).
In Python, file names, command line arguments, and environment variables are
represented using the string type. On some systems, decoding these strings to
and from bytes is necessary before passing them to the operating system. Python
uses the file system encoding to perform this conversion (see
:func:`sys.getfilesystemencoding`).
.. versionchanged:: 3.1
On some systems, conversion using the file system encoding may
fail. In this case, Python uses the ``surrogateescape`` encoding
error handler, which means that undecodable bytes are replaced by a
Unicode character U+DCxx on decoding, and these are again
translated to the original byte on encoding.
On some systems, conversion using the file system encoding may fail. In this
case, Python uses the ``surrogateescape`` encoding error handler, which means
that undecodable bytes are replaced by a Unicode character U+DCxx on
decoding, and these are again translated to the original byte on encoding.
The file system encoding must guarantee to successfully decode all
bytes below 128. If the file system encoding fails to provide this
guarantee, API functions may raise UnicodeErrors.
The file system encoding must guarantee to successfully decode all bytes
below 128. If the file system encoding fails to provide this guarantee, API
functions may raise UnicodeErrors.
.. _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
process handles to be killed.
.. versionadded:: 3.2 Windows support
.. versionadded:: 3.2
Windows support.
.. function:: killpg(pgid, sig)

View File

@ -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
the column where annotation should start.
.. versionadded:: 3.2 the *annotate* argument.
.. versionadded:: 3.2
The *annotate* argument.
.. function:: genops(pickle)

View File

@ -68,8 +68,7 @@ The :mod:`runpy` module provides two functions:
.. versionchanged:: 3.1
Added ability to execute packages by looking for a ``__main__``
submodule
Added ability to execute packages by looking for a ``__main__`` submodule.
.. function:: run_path(file_path, init_globals=None, run_name=None)

View File

@ -229,11 +229,10 @@ Connection Objects
.. attribute:: Connection.in_transaction
.. versionadded:: 3.2
:const:`True` if a transaction is active (there are uncommitted changes),
:const:`False` otherwise. Read-only attribute.
.. versionadded:: 3.2
.. method:: Connection.cursor([cursorClass])
@ -241,7 +240,6 @@ Connection Objects
supplied, this must be a custom cursor class that extends
:class:`sqlite3.Cursor`.
.. method:: Connection.commit()
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)
.. versionadded:: 3.2
This routine allows/disallows the SQLite engine to load SQLite extensions
from shared libraries. SQLite extensions can define new functions,
aggregates or whole new virtual table implementations. One well-known
extension is the fulltext-search extension distributed with SQLite.
.. versionadded:: 3.2
.. literalinclude:: ../includes/sqlite3/load_extension.py
.. method:: Connection.load_extension(path)
.. versionadded:: 3.2
This routine loads a SQLite extension from a shared library. You have to
enable extension loading with ``enable_load_extension`` before you can use
this routine.
.. versionadded:: 3.2
.. attribute:: Connection.row_factory
You can change this attribute to a callable that accepts the cursor and the

View File

@ -459,7 +459,7 @@ Additional Methods on Integer Types
.. 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.
@ -491,7 +491,7 @@ Additional Methods on Integer Types
.. 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.
@ -996,7 +996,8 @@ functions based on regular expressions.
list of possible encodings, see section :ref:`standard-encodings`.
.. versionchanged:: 3.1
Added support for keyword arguments added.
Support for keyword arguments added.
.. method:: str.endswith(suffix[, start[, end]])

View File

@ -707,9 +707,9 @@ always available.
every virtual instruction, maximizing responsiveness as well as overhead.
.. deprecated:: 3.2
This function doesn't have an effect anymore, as the internal logic
for thread switching and asynchronous tasks has been rewritten.
Use :func:`setswitchinterval` instead.
This function doesn't have an effect anymore, as the internal logic for
thread switching and asynchronous tasks has been rewritten. Use
:func:`setswitchinterval` instead.
.. function:: setdefaultencoding(name)
@ -958,7 +958,7 @@ always available.
and so on.
.. versionchanged:: 3.1
Added named component attributes
Added named component attributes.
.. data:: warnoptions

View File

@ -166,6 +166,7 @@ This module also defines the following constant:
.. versionadded:: 3.2
Detailed interfaces for the objects are documented below.
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
The *timeout* parameter is new.
.. method:: Lock.release()
Release a lock.

View File

@ -210,7 +210,7 @@ For a list of all the command line options::
python -m unittest -h
.. versionchanged:: 3.2
.. versionchanged:: 3.2
In earlier versions it was only possible to run individual test methods and
not modules or classes.
@ -861,8 +861,8 @@ Test cases
Supplying both *delta* and *places* raises a ``TypeError``.
.. versionchanged:: 3.2
Objects that compare equal automatically fail.
Added the ``delta`` keyword argument.
Objects that compare equal automatically fail. Added the ``delta``
keyword argument.
.. deprecated:: 3.1
:meth:`failIfAlmostEqual`; use :meth:`assertNotAlmostEqual`.
@ -941,9 +941,9 @@ Test cases
If specified, *msg* will be used as the error message on failure.
.. versionadded:: 3.1
.. deprecated:: 3.2
.. method:: assertItemsEqual(actual, expected, msg=None)
Test that sequence *expected* contains the same elements as *actual*,
@ -960,6 +960,7 @@ Test cases
.. versionadded:: 3.2
.. method:: assertSetEqual(set1, set2, msg=None)
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
:attr:`unexpectedSuccesses` attribute.
.. class:: TextTestResult(stream, descriptions, verbosity)
A concrete implementation of :class:`TestResult` used by the
:class:`TextTestRunner`.
A concrete implementation of :class:`TestResult` used by the
: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

View File

@ -349,7 +349,7 @@ The :mod:`urllib.parse` module defines the following functions:
parameters are sent the :func:`quote_plus` for encoding.
.. versionchanged:: 3.2
query paramater supports bytes and string.
Query parameter supports bytes and string objects.
.. seealso::

View File

@ -309,13 +309,13 @@ Element Objects
.. method:: getchildren()
.. deprecated:: 2.7
.. deprecated:: 3.2
Use ``list(elem)`` or iteration.
.. method:: getiterator(tag=None)
.. deprecated:: 2.7
.. deprecated:: 3.2
Use method :meth:`Element.iter` instead.
@ -427,7 +427,7 @@ ElementTree Objects
.. method:: getiterator(tag=None)
.. deprecated:: 2.7
.. deprecated:: 3.2
Use method :meth:`ElementTree.iter` instead.
@ -589,7 +589,7 @@ XMLParser Objects
.. method:: doctype(name, pubid, system)
.. deprecated:: 2.7
.. deprecated:: 3.2
Define the :meth:`TreeBuilder.doctype` method on a custom TreeBuilder
target.

View File

@ -66,6 +66,7 @@ The module defines the following items:
.. versionchanged:: 3.1
Support for file and file-like objects.
.. data:: ZIP_STORED
The numeric constant for an uncompressed archive member.

View File

@ -95,7 +95,7 @@ zipimporter Objects
was imported. Raise :exc:`ZipImportError` if the module couldn't be
found.
.. versionadded:: 3.1
.. versionadded:: 3.1
.. method:: get_source(fullname)

View File

@ -115,6 +115,7 @@ source.
.. versionchanged:: 3.1
Supply the package name to run a ``__main__`` submodule.
.. describe:: -
Read commands from standard input (:data:`sys.stdin`). If standard input is