gh-99202: Fix extension type from documentation for compiling in C++20 mode (#102518)

This commit is contained in:
Jeffrey Newman 2023-04-06 10:59:36 -05:00 committed by GitHub
parent 52bc2e7b9d
commit 23cf1e20a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 10 deletions

View file

@ -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. ::