Skip to content

Commit 8b8ff0f

Browse files
committed
Updated doc.
1 parent 08e3ecf commit 8b8ff0f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Doc/c-api/module.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ Module Objects
9292
9393
.. c:function:: void* PyModule_GetState(PyObject *module)
9494
95-
Return the "state" of the module, that is, a pointer to the block of memory
96-
allocated at module creation time, or ``NULL``.
95+
The module’s state can be stored in per‑module memory, which is obtained by calling this function.
96+
This makes modules safe to use with sub‑interpreters.
9797
98-
Takes a pointer to a modlue as an argument.
99-
100-
See
101-
:c:member:`PyModuleDef.m_size`.
98+
The amount of memory allocated for the module’s state is specified by the :c:member:`PyModuleDef.m_size` field.
10299
100+
The function returns a pointer to the state memory, or **NULL**
101+
if the argument is not a `PyModule` object or
102+
if the module does not support local state (i.e., :c:member:`PyModuleDef.m_size` is ``-1``).
103103
104104
.. c:function:: PyModuleDef* PyModule_GetDef(PyObject *module)
105105

0 commit comments

Comments
 (0)