mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-99202: Fix extension type from documentation for compiling in C++20 mode (#102518)
This commit is contained in:
parent
52bc2e7b9d
commit
23cf1e20a6
6 changed files with 11 additions and 10 deletions
|
@ -88,7 +88,7 @@ standard Python floats::
|
|||
The second bit is the definition of the type object. ::
|
||||
|
||||
static PyTypeObject CustomType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.tp_name = "custom.Custom",
|
||||
.tp_doc = PyDoc_STR("Custom objects"),
|
||||
.tp_basicsize = sizeof(CustomObject),
|
||||
|
@ -109,7 +109,7 @@ common practice to not specify them explicitly unless you need them.
|
|||
|
||||
We're going to pick it apart, one field at a time::
|
||||
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
|
||||
|
||||
This line is mandatory boilerplate to initialize the ``ob_base``
|
||||
field mentioned above. ::
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue