Skip to content

Conversation

@encukou
Copy link

@encukou encukou commented Nov 11, 2025

tests:

  • Test with a single-phase module as well.
  • Ensure the module got initialized.
  • Avoid internal API. (You probably want _call_with_frames_removed in the real world, but you can lose the _imp; spec_from_loader is re-exported and documented publicly)

docs:

  • Note that the module is not initialized.
  • Be explicit about errors.

The PyModule_Exec function (used in both tests and docs) is new for PEP-793, implemented in main but only documented in a draft PR as of right now (python#141197).


📚 Documentation preview 📚: https://cpython-previews--27.org.readthedocs.build/

@itamaro itamaro merged commit f652399 into itamaro:gh-116146-create-builtin-initfunc Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants