mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
gh-134160: Use multi-phase init in documentation examples (#134296)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
3c0525126e
commit
96905bdd27
12 changed files with 231 additions and 199 deletions
|
|
@ -153,6 +153,6 @@ Allocating Objects on the Heap
|
|||
|
||||
.. seealso::
|
||||
|
||||
:c:func:`PyModule_Create`
|
||||
:ref:`moduleobjects`
|
||||
To allocate and create extension modules.
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ complete listing.
|
|||
item defined in the module file. Example::
|
||||
|
||||
static struct PyModuleDef spam_module = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
.m_base = PyModuleDef_HEAD_INIT,
|
||||
.m_name = "spam",
|
||||
...
|
||||
};
|
||||
|
|
@ -135,7 +135,7 @@ complete listing.
|
|||
PyMODINIT_FUNC
|
||||
PyInit_spam(void)
|
||||
{
|
||||
return PyModule_Create(&spam_module);
|
||||
return PyModuleDef_Init(&spam_module);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue