Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Dec 8, 2025

Add init_callback and init_callback_arg members to PyConfig.


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

Add init_callback and init_callback_arg members to PyConfig.
@vstinner
Copy link
Member Author

vstinner commented Dec 8, 2025

Current documentation:

Set an initialization callback. It allows executing code as soon as the
Python interpreter is initialized, before the first import. For example, it
can be used to add a meta path importer into sys.meta_path.

Python is not fully initialized yet when the callback is called. For
example, sys.stdout may not exist yet.

@vstinner
Copy link
Member Author

vstinner commented Dec 9, 2025

@indygreg: Hi, would such C API fit your needs for PyOxidizer?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant