Skip to content

Commit fa6ddd4

Browse files
itamaroclaude
andcommitted
Fix ModuleSpec.name reference, clarify why PyModule_Exec is still recommended
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BRMivCCCk5sjAJ6GmBEDUv
1 parent f24102e commit fa6ddd4

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎Doc/c-api/extension-modules.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ in the following ways:
328328
tuple where:
329329
330330
- *module_name* is the module's full dotted name, taken from
331-
:py:attr:`~importlib.machinery.ModuleSpec`
332-
(or similar argument to importing function).
331+
:py:attr:`ModuleSpec.name <importlib.machinery.ModuleSpec.name>`
332+
(or the equivalent argument of the importing function).
333333
Note that names that the initialization function uses to create the module
334334
(for example, :c:member:`PyModuleDef.m_name`) are not taken into account.
335335
- *file_name* is the extension's file name.

‎Doc/c-api/import.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ Importing Modules
434434
contents instead of calling *initfunc* again.
435435
- The module will be fully initialized by *initfunc*.
436436
Calling :c:func:`PyModule_Exec` on it will have no effect, though it is
437-
recommended (in case the module's implementation will change).
437+
still recommended, in case the module later switches to
438+
:ref:`multi-phase initialization <multi-phase-initialization>`.
438439
- Also, if the *spec*'s :py:attr:`!name` contains dots, this name is used
439440
for prepending a parent package to the new module's
440441
:attr:`~module.__name__`.

0 commit comments

Comments
 (0)