Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
argument, and store in the instance's :c:member:`~PyVarObject.ob_size` field.
Note that the :c:member:`~PyVarObject.ob_size` field may later be used for
other purposes. For example, :py:type:`int` instances use the bits of
:c:member:`~PyVarObject.ob_size` in an implementation-defined
way; the underlying storage and its size should be accessed using
:c:func:`PyLong_Export`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This note was backported all the way to 3.12 in #129850, however PyLong_Export was only added in 3.14 as part of PEP-757.

CC @ZeroIntensity

:c:member:`~PyVarObject.ob_size` in an implementation-defined way.

.. note::

Expand Down Expand Up @@ -2745,24 +2743,24 @@ Buffer Object Structures
steps:

(1) Check if the request can be met. If not, raise :exc:`BufferError`,
set :c:expr:`view->obj` to ``NULL`` and return ``-1``.
set ``view->obj`` to ``NULL`` and return ``-1``.

(2) Fill in the requested fields.

(3) Increment an internal counter for the number of exports.

(4) Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`.
(4) Set ``view->obj`` to *exporter* and increment ``view->obj``.

(5) Return ``0``.

If *exporter* is part of a chain or tree of buffer providers, two main
schemes can be used:

* Re-export: Each member of the tree acts as the exporting object and
sets :c:expr:`view->obj` to a new reference to itself.
sets ``view->obj`` to a new reference to itself.

* Redirect: The buffer request is redirected to the root object of the
tree. Here, :c:expr:`view->obj` will be a new reference to the root
tree. Here, ``view->obj`` will be a new reference to the root
object.

The individual fields of *view* are described in section
Expand Down Expand Up @@ -2806,7 +2804,7 @@ Buffer Object Structures
*view* argument.


This function MUST NOT decrement :c:expr:`view->obj`, since that is
This function MUST NOT decrement ``view->obj``, since that is
done automatically in :c:func:`PyBuffer_Release` (this scheme is
useful for breaking reference cycles).

Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Doc/c-api/init_config.rst
Doc/c-api/intro.rst
Doc/c-api/module.rst
Doc/c-api/stable.rst
Doc/c-api/typeobj.rst
Doc/library/ast.rst
Doc/library/asyncio-extending.rst
Doc/library/asyncio-policy.rst
Expand Down
Loading