Skip to content

gh-157384: Document and test PyImport_CreateModuleFromInitfunc() semantics - #157389

Open
itamaro wants to merge 1 commit into
python:mainfrom
itamaro:gh-116146-initfunc-docs-tests
Open

gh-157384: Document and test PyImport_CreateModuleFromInitfunc() semantics#157389
itamaro wants to merge 1 commit into
python:mainfrom
itamaro:gh-116146-initfunc-docs-tests

Conversation

@itamaro

@itamaro itamaro commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Document that single-phase init modules are added to sys.modules by the call itself (unlike multi-phase init modules), and that the spec name identifies the module, so a later call with the same name and a different init function reuses the cached module without calling the new init function. Add regression tests for both behaviors.

AI assisted with Claude Fable 5.1

…) semantics

Document that single-phase init modules are added to sys.modules by
the call itself (unlike multi-phase init modules), and that the spec
name identifies the module, so a later call with the same name and a
different init function reuses the cached module without calling the
new init function.  Add regression tests for both behaviors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HoZE3WdRWQshvinfBZ137N
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34530624 | 📁 Comparing 16b70db against main (2cd6d4b)

  🔍 Preview build  

1 file changed
± c-api/import.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant