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
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::
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)
.. versionadded:: 3.1
+
.. cfunction:: PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
Decode a null-terminated string using :cdata:`Py_FileSystemDefaultEncoding`
: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`.
lightweight and require no more memory than regular tuples.
.. versionchanged:: 3.1
- added support for *rename*.
+ Added support for *rename*.
Example:
class.
-
:class:`UserList` objects
-------------------------
.. 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)
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()
Return the new absolute position.
.. versionadded:: 3.1
- The ``SEEK_*`` constants
+ The ``SEEK_*`` constants.
.. method:: seekable()
.. versionadded:: 3.1
+
.. function:: compress(data, selectors)
Make an iterator that filters elements from *data* returning only those that
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)
:const:`NOTSET` is found, and that value is returned.
+
.. method:: Logger.debug(msg, *args, **kwargs)
Logs a message with level :const:`DEBUG` on this logger. The *msg* is the
methods have the same signatures as their counterparts in :class:`Logger`, so
you can use the two types of instances interchangeably.
+ The :meth:`isEnabledFor` method was added to :class:`LoggerAdapter`. This
+ method delegates to the underlying logger.
+
Thread Safety
-------------
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:
It is recommended that the :mod:`sys` module be left alone when invoking this
function from threaded code.
-
.. 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.
.. seealso::
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,
:func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a
list of possible encodings, see section :ref:`standard-encodings`.
+ .. versionchanged:: 3.1
+ Support for keyword arguments added.
+
.. method:: str.endswith(suffix[, start[, end]])
and so on.
.. versionchanged:: 3.1
- Added named component attributes
+ Added named component attributes.
.. data:: warnoptions
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::
.. versionchanged:: 3.1
Support for file and file-like objects.
+
.. data:: ZIP_STORED
The numeric constant for an uncompressed archive member.
was imported. Raise :exc:`ZipImportError` if the module couldn't be
found.
- .. versionadded:: 3.1
+ .. versionadded:: 3.1
.. method:: get_source(fullname)