bpo-45790: List macros in same order in which fields are described (GH-29529)

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
rtobar 2022-04-05 10:36:33 +08:00 committed by GitHub
parent 5a4973e29f
commit b275267aa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -67,8 +67,8 @@ The first bit is::
This is what a Custom object will contain. ``PyObject_HEAD`` is mandatory This is what a Custom object will contain. ``PyObject_HEAD`` is mandatory
at the start of each object struct and defines a field called ``ob_base`` at the start of each object struct and defines a field called ``ob_base``
of type :c:type:`PyObject`, containing a pointer to a type object and a of type :c:type:`PyObject`, containing a pointer to a type object and a
reference count (these can be accessed using the macros :c:macro:`Py_REFCNT` reference count (these can be accessed using the macros :c:macro:`Py_TYPE`
and :c:macro:`Py_TYPE` respectively). The reason for the macro is to and :c:macro:`Py_REFCNT` respectively). The reason for the macro is to
abstract away the layout and to enable additional fields in :ref:`debug builds abstract away the layout and to enable additional fields in :ref:`debug builds
<debug-build>`. <debug-build>`.

View File

@ -0,0 +1,2 @@
Adjust inaccurate phrasing in :doc:`../extending/newtypes_tutorial` about the
``ob_base`` field and the macros used to access its contents.