@@ -408,7 +408,7 @@ Importing Modules
408408
409409 *spec* must be a :class:`~importlib.machinery.ModuleSpec` object.
410410
411- *initfunc* must be an :ref:`initialization function <extension-export-hook >`,
411+ *initfunc* must be an :ref:`initialization function <extension-pyinit >`,
412412 the same as for :c:func:`PyImport_AppendInittab`.
413413
414414 On success, create and return a module object.
@@ -417,19 +417,16 @@ Importing Modules
417417 (Custom importers should do this in their
418418 :py:meth: `~importlib.abc.Loader.exec_module ` method.)
419419
420- If *initfunc* uses legacy single-phase initialization (that is, it
421- creates the module with :c:func: `PyModule_Create `), the module is fully
422- initialized by *initfunc* itself, and it is also added to
423- :data:`sys.modules` under the spec's name, as is done for modules
424- registered with :c:func:`PyImport_AppendInittab`.
420+ If *initfunc* uses
421+ :ref:`legacy single-phase initialization <single-phase-initialization>`,
422+ the module is fully initialized by *initfunc* itself, and it is also
423+ added to :data:`sys.modules` under the spec's name.
425424 Calling :c:func:`PyModule_Exec` on such a module is still safe.
426-
427- The spec's name identifies the module for the purposes of the import
428- system, in the same way as for built-in modules.
429- If a single-phase init module was previously created under the same name
430- (by this function, or in another interpreter), the existing module
431- definition is reused and *initfunc* is not called, so a later call with
432- the same name but a different *initfunc* has no effect.
425+ As with any single-phase module, the spec's name identifies the module:
426+ if a single-phase module was previously created under the same name
427+ (by this function, or in another interpreter), Python does not call
428+ *initfunc* again but reuses the saved module contents, so a later call
429+ with the same name but a different *initfunc* has no effect.
433430
434431 On error, return NULL with an exception set.
435432
0 commit comments