@@ -38,7 +38,7 @@ Extension export hook
3838
3939The export hook must be an exported function with the following signature:
4040
41- .. c :function :: PyModuleDef_Slot *PyModExport_modulename (void)
41+ .. c :function :: PySlot *PyModExport_modulename (void)
4242
4343For modules with ASCII-only names, the :ref:`export hook <extension-export-hook>`
4444must be named :samp:`PyModExport_{<name>}`,
@@ -57,7 +57,7 @@ Python's *punycode* encoding with hyphens replaced by underscores. In Python:
5757 suffix = b ' U_' + name.encode(' punycode' ).replace(b ' -' , b ' _' )
5858 return b ' PyModExport' + suffix
5959
60- The export hook returns an array of :c:type: `PyModuleDef_Slot ` entries,
60+ The export hook returns an array of :c:type: `PySlot ` entries,
6161terminated by an entry with a slot ID of ``0 ``.
6262These slots describe how the module should be created and initialized.
6363
@@ -75,20 +75,20 @@ It is recommended to define the export hook function using a helper macro:
7575 Declare an extension module export hook.
7676 This macro:
7777
78- * specifies the :c:expr: `PyModuleDef_Slot * ` return type,
78+ * specifies the :c:expr: `PySlot * ` return type,
7979 * adds any special linkage declarations required by the platform, and
8080 * for C++, declares the function as ``extern "C" ``.
8181
8282For example, a module called ``spam `` would be defined like this::
8383
8484 PyABIInfo_VAR(abi_info);
8585
86- static PyModuleDef_Slot spam_slots[] = {
87- { Py_mod_abi, &abi_info} ,
88- { Py_mod_name, "spam"} ,
89- { Py_mod_init, spam_init_function} ,
86+ static PySlot spam_slots[] = {
87+ PySlot_STATIC_DATA( Py_mod_abi, &abi_info) ,
88+ PySlot_STATIC_DATA( Py_mod_name, "spam") ,
89+ PySlot_FUNC( Py_mod_init, spam_init_function) ,
9090 ...
91- {0, NULL},
91+ PySlot_END
9292 };
9393
9494 PyMODEXPORT_FUNC
0 commit comments