diff options
author | Jeffrey Newman <jeff@newman.me> | 2023-04-06 15:59:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 15:59:36 (GMT) |
commit | 23cf1e20a6470588fbc64483031ceeec7614dc56 (patch) | |
tree | 1a687dbdac35b44444eabe31e498a6ad69d683a5 /Doc/extending | |
parent | 52bc2e7b9d451821513a580a9b73c20cfdcf2b21 (diff) | |
download | cpython-23cf1e20a6470588fbc64483031ceeec7614dc56.zip cpython-23cf1e20a6470588fbc64483031ceeec7614dc56.tar.gz cpython-23cf1e20a6470588fbc64483031ceeec7614dc56.tar.bz2 |
gh-99202: Fix extension type from documentation for compiling in C++20 mode (#102518)
Diffstat (limited to 'Doc/extending')
-rw-r--r-- | Doc/extending/newtypes_tutorial.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/extending/newtypes_tutorial.rst b/Doc/extending/newtypes_tutorial.rst index 54de3fd..f89934a 100644 --- a/Doc/extending/newtypes_tutorial.rst +++ b/Doc/extending/newtypes_tutorial.rst @@ -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. :: |