diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst index f7f4d37d4c721f..29292da2e1a78c 100644 --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -633,7 +633,7 @@ state: Add a string constant to *module* as *name*. This convenience function can be used from the module's initialization function. The string *value* must be - ``NULL``-terminated. + ``NULL``-terminated and UTF-8 encoded. Return ``-1`` with an exception set on error, ``0`` on success. This is a convenience function that calls @@ -651,7 +651,13 @@ state: .. c:macro:: PyModule_AddStringMacro(module, macro) - Add a string constant to *module*. + Add a string constant to *module*. The name and the value are taken from + *macro*. For example ``PyModule_AddStrMacro(module, STRINGLIB_TYPE_NAME)`` + adds the string constant *STRINGLIB_TYPE_NAME* with the value of + *STRINGLIB_TYPE_NAME* to *module*. The string *value* must be + ``NULL``-terminated and UTF-8 encoded. + Return ``-1`` with an exception set on error, ``0`` on success. + .. c:function:: int PyModule_AddType(PyObject *module, PyTypeObject *type)