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
|
@ -7,7 +7,7 @@ typedef struct {
|
|||
} CustomObject;
|
||||
|
||||
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),
|
||||
|
@ -17,7 +17,7 @@ static PyTypeObject CustomType = {
|
|||
};
|
||||
|
||||
static PyModuleDef custommodule = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
.m_base = PyModuleDef_HEAD_INIT,
|
||||
.m_name = "custom",
|
||||
.m_doc = "Example module that creates an extension type.",
|
||||
.m_size = -1,
|
||||
|
|
|
@ -90,7 +90,7 @@ static PyMethodDef Custom_methods[] = {
|
|||
};
|
||||
|
||||
static PyTypeObject CustomType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.tp_name = "custom2.Custom",
|
||||
.tp_doc = PyDoc_STR("Custom objects"),
|
||||
.tp_basicsize = sizeof(CustomObject),
|
||||
|
@ -104,7 +104,7 @@ static PyTypeObject CustomType = {
|
|||
};
|
||||
|
||||
static PyModuleDef custommodule = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
.m_base =PyModuleDef_HEAD_INIT,
|
||||
.m_name = "custom2",
|
||||
.m_doc = "Example module that creates an extension type.",
|
||||
.m_size = -1,
|
||||
|
|
|
@ -130,7 +130,7 @@ static PyMethodDef Custom_methods[] = {
|
|||
};
|
||||
|
||||
static PyTypeObject CustomType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.tp_name = "custom3.Custom",
|
||||
.tp_doc = PyDoc_STR("Custom objects"),
|
||||
.tp_basicsize = sizeof(CustomObject),
|
||||
|
@ -145,7 +145,7 @@ static PyTypeObject CustomType = {
|
|||
};
|
||||
|
||||
static PyModuleDef custommodule = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
.m_base = PyModuleDef_HEAD_INIT,
|
||||
.m_name = "custom3",
|
||||
.m_doc = "Example module that creates an extension type.",
|
||||
.m_size = -1,
|
||||
|
|
|
@ -146,7 +146,7 @@ static PyMethodDef Custom_methods[] = {
|
|||
};
|
||||
|
||||
static PyTypeObject CustomType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.ob_base = PyVarObject_HEAD_INIT(NULL, 0)
|
||||
.tp_name = "custom4.Custom",
|
||||
.tp_doc = PyDoc_STR("Custom objects"),
|
||||
.tp_basicsize = sizeof(CustomObject),
|
||||
|
@ -163,7 +163,7 @@ static PyTypeObject CustomType = {
|
|||
};
|
||||
|
||||
static PyModuleDef custommodule = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
.m_base = PyModuleDef_HEAD_INIT,
|
||||
.m_name = "custom4",
|
||||
.m_doc = "Example module that creates an extension type.",
|
||||
.m_size = -1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue