File tree Expand file tree Collapse file tree 6 files changed +11
-10
lines changed
Misc/NEWS.d/next/Documentation Expand file tree Collapse file tree 6 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ standard Python floats::
8888The second bit is the definition of the type object. ::
8989
9090 static PyTypeObject CustomType = {
91- PyVarObject_HEAD_INIT(NULL, 0)
91+ .ob_base = PyVarObject_HEAD_INIT(NULL, 0)
9292 .tp_name = "custom.Custom",
9393 .tp_doc = PyDoc_STR("Custom objects"),
9494 .tp_basicsize = sizeof(CustomObject),
@@ -109,7 +109,7 @@ common practice to not specify them explicitly unless you need them.
109109
110110We're going to pick it apart, one field at a time::
111111
112- PyVarObject_HEAD_INIT(NULL, 0)
112+ .ob_base = PyVarObject_HEAD_INIT(NULL, 0)
113113
114114This line is mandatory boilerplate to initialize the ``ob_base ``
115115field mentioned above. ::
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ typedef struct {
77} CustomObject ;
88
99static PyTypeObject CustomType = {
10- PyVarObject_HEAD_INIT (NULL , 0 )
10+ . ob_base = PyVarObject_HEAD_INIT (NULL , 0 )
1111 .tp_name = "custom.Custom" ,
1212 .tp_doc = PyDoc_STR ("Custom objects" ),
1313 .tp_basicsize = sizeof (CustomObject ),
@@ -17,7 +17,7 @@ static PyTypeObject CustomType = {
1717};
1818
1919static PyModuleDef custommodule = {
20- PyModuleDef_HEAD_INIT ,
20+ . m_base = PyModuleDef_HEAD_INIT ,
2121 .m_name = "custom" ,
2222 .m_doc = "Example module that creates an extension type." ,
2323 .m_size = -1 ,
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ static PyMethodDef Custom_methods[] = {
9090};
9191
9292static PyTypeObject CustomType = {
93- PyVarObject_HEAD_INIT (NULL , 0 )
93+ . ob_base = PyVarObject_HEAD_INIT (NULL , 0 )
9494 .tp_name = "custom2.Custom" ,
9595 .tp_doc = PyDoc_STR ("Custom objects" ),
9696 .tp_basicsize = sizeof (CustomObject ),
@@ -104,7 +104,7 @@ static PyTypeObject CustomType = {
104104};
105105
106106static PyModuleDef custommodule = {
107- PyModuleDef_HEAD_INIT ,
107+ . m_base = PyModuleDef_HEAD_INIT ,
108108 .m_name = "custom2" ,
109109 .m_doc = "Example module that creates an extension type." ,
110110 .m_size = -1 ,
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ static PyMethodDef Custom_methods[] = {
130130};
131131
132132static PyTypeObject CustomType = {
133- PyVarObject_HEAD_INIT (NULL , 0 )
133+ . ob_base = PyVarObject_HEAD_INIT (NULL , 0 )
134134 .tp_name = "custom3.Custom" ,
135135 .tp_doc = PyDoc_STR ("Custom objects" ),
136136 .tp_basicsize = sizeof (CustomObject ),
@@ -145,7 +145,7 @@ static PyTypeObject CustomType = {
145145};
146146
147147static PyModuleDef custommodule = {
148- PyModuleDef_HEAD_INIT ,
148+ . m_base = PyModuleDef_HEAD_INIT ,
149149 .m_name = "custom3" ,
150150 .m_doc = "Example module that creates an extension type." ,
151151 .m_size = -1 ,
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ static PyMethodDef Custom_methods[] = {
146146};
147147
148148static PyTypeObject CustomType = {
149- PyVarObject_HEAD_INIT (NULL , 0 )
149+ . ob_base = PyVarObject_HEAD_INIT (NULL , 0 )
150150 .tp_name = "custom4.Custom" ,
151151 .tp_doc = PyDoc_STR ("Custom objects" ),
152152 .tp_basicsize = sizeof (CustomObject ),
@@ -163,7 +163,7 @@ static PyTypeObject CustomType = {
163163};
164164
165165static PyModuleDef custommodule = {
166- PyModuleDef_HEAD_INIT ,
166+ . m_base = PyModuleDef_HEAD_INIT ,
167167 .m_name = "custom4" ,
168168 .m_doc = "Example module that creates an extension type." ,
169169 .m_size = -1 ,
Original file line number Diff line number Diff line change 1+ Fix extension type from documentation for compiling in C++20 mode
You can’t perform that action at this time.
0 commit comments