Skip to content

Commit c3dbb4b

Browse files
committed
Add more detail to the PyModule_AddStringMacro docs
1 parent c1a4591 commit c3dbb4b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Doc/c-api/module.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,13 @@ state:
651651
652652
.. c:macro:: PyModule_AddStringMacro(module, macro)
653653
654-
Add a string constant to *module*.
654+
Add a string constant to *module*. The name and the value are taken from
655+
*macro*. For example ``PyModule_AddStrMacro(module, STRINGLIB_TYPE_NAME)``
656+
adds the string constant *STRINGLIB_TYPE_NAME* with the value of
657+
*STRINGLIB_TYPE_NAME* to *module*. The string *value* must be
658+
``NULL``-terminated and UTF-8 encoded.
659+
Return ``-1`` with an exception set on error, ``0`` on success.
660+
655661
656662
.. c:function:: int PyModule_AddType(PyObject *module, PyTypeObject *type)
657663

0 commit comments

Comments
 (0)