mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Merge in all documentation changes since branching 3.4.0rc1.
This commit is contained in:
parent
b6b6a6d587
commit
3732ed2414
93 changed files with 2018 additions and 556 deletions
|
|
@ -45,6 +45,7 @@ in any early abort case).
|
|||
Unless otherwise stated, buffers are not NUL-terminated.
|
||||
|
||||
.. note::
|
||||
|
||||
For all ``#`` variants of formats (``s#``, ``y#``, etc.), the type of
|
||||
the length argument (int or :c:type:`Py_ssize_t`) is controlled by
|
||||
defining the macro :c:macro:`PY_SSIZE_T_CLEAN` before including
|
||||
|
|
|
|||
|
|
@ -525,11 +525,11 @@ Exception Objects
|
|||
reference, as accessible from Python through :attr:`__cause__`.
|
||||
|
||||
|
||||
.. c:function:: void PyException_SetCause(PyObject *ex, PyObject *ctx)
|
||||
.. c:function:: void PyException_SetCause(PyObject *ex, PyObject *cause)
|
||||
|
||||
Set the cause associated with the exception to *ctx*. Use *NULL* to clear
|
||||
it. There is no type check to make sure that *ctx* is either an exception
|
||||
instance or :const:`None`. This steals a reference to *ctx*.
|
||||
Set the cause associated with the exception to *cause*. Use *NULL* to clear
|
||||
it. There is no type check to make sure that *cause* is either an exception
|
||||
instance or :const:`None`. This steals a reference to *cause*.
|
||||
|
||||
:attr:`__suppress_context__` is implicitly set to ``True`` by this function.
|
||||
|
||||
|
|
|
|||
|
|
@ -582,6 +582,7 @@ code, or when embedding the Python interpreter:
|
|||
.. index:: module: _thread
|
||||
|
||||
.. note::
|
||||
|
||||
When only the main thread exists, no GIL operations are needed. This is a
|
||||
common situation (most Python programs do not use threads), and the lock
|
||||
operations slow the interpreter down a bit. Therefore, the lock is not
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ There are only a few functions special to module objects.
|
|||
|
||||
Return a pointer to the :c:type:`PyModuleDef` struct from which the module was
|
||||
created, or *NULL* if the module wasn't created with
|
||||
:c:func:`PyModule_Create`.i
|
||||
:c:func:`PyModule_Create`.
|
||||
|
||||
.. c:function:: PyObject* PyState_FindModule(PyModuleDef *def)
|
||||
|
||||
|
|
|
|||
|
|
@ -357,9 +357,9 @@ attribute is considered sufficient for this determination.
|
|||
|
||||
.. c:function:: Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t default)
|
||||
|
||||
Return an estimated length for the object *o*. First trying to return its
|
||||
actual length, then an estimate using ``__length_hint__``, and finally
|
||||
returning the default value. On error ``-1`` is returned. This is the
|
||||
Return an estimated length for the object *o*. First try to return its
|
||||
actual length, then an estimate using :meth:`~object.__length_hint__`, and
|
||||
finally return the default value. On error return ``-1``. This is the
|
||||
equivalent to the Python expression ``operator.length_hint(o, default)``.
|
||||
|
||||
.. versionadded:: 3.4
|
||||
|
|
|
|||
|
|
@ -129,6 +129,14 @@ type.
|
|||
Initializes a struct sequence type *type* from *desc* in place.
|
||||
|
||||
|
||||
.. c:function:: int PyStructSequence_InitType2(PyTypeObject *type, PyStructSequence_Desc *desc)
|
||||
|
||||
The same as ``PyStructSequence_InitType``, but returns ``0`` on success and ``-1`` on
|
||||
failure.
|
||||
|
||||
.. versionadded:: 3.4
|
||||
|
||||
|
||||
.. c:type:: PyStructSequence_Desc
|
||||
|
||||
Contains the meta information of a struct sequence type to create.
|
||||
|
|
|
|||
|
|
@ -205,9 +205,8 @@ type objects) *must* have the :attr:`ob_size` field.
|
|||
bit currently defined is :const:`Py_PRINT_RAW`. When the :const:`Py_PRINT_RAW`
|
||||
flag bit is set, the instance should be printed the same way as :c:member:`~PyTypeObject.tp_str`
|
||||
would format it; when the :const:`Py_PRINT_RAW` flag bit is clear, the instance
|
||||
should be printed the same was as :c:member:`~PyTypeObject.tp_repr` would format it. It should
|
||||
return ``-1`` and set an exception condition when an error occurred during the
|
||||
comparison.
|
||||
should be printed the same way as :c:member:`~PyTypeObject.tp_repr` would format it. It should
|
||||
return ``-1`` and set an exception condition when an error occurs.
|
||||
|
||||
It is possible that the :c:member:`~PyTypeObject.tp_print` field will be deprecated. In any case,
|
||||
it is recommended not to define :c:member:`~PyTypeObject.tp_print`, but instead to rely on
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue