Repository navigation
[cpyrt] Move Python interpreter embedding out of cpyrt - #139
Open
guitargeek wants to merge 1 commit into
Open
guitargeek wants to merge 1 commit into
guitargeek wants to merge 1 commit into
Conversation
cppjit is a Python extension library, not an embedding library. Remove the PyConfig/Py_InitializeFromConfig fallback from cpyrt's private Initialize() and let it fail gracefully when the interpreter was not initialized by the embedding application, instead of initializing a bare interpreter from inside an extension module. Along the same boundary, move the "access to the python interpreter" functions out of cpyrt entirely: Import(), Exec(), ExecScript() and Prompt() use none of cppjit's proxy machinery. Also drops the gMainDict bookkeeping they depended on, and exposes the extension module itself via GetThisModule() for an embedding framework to attach imported modules to.
guitargeek
force-pushed
the
tpython-extraction
branch
from
October 6, 2026 08:05
3c2ea61 to
26bd507
Compare
Collaborator
|
Is there a way to test usage of |
Collaborator
Author
|
In principle we could do that, but I wouldn't require a test for a one-line getter |
Collaborator
|
My intent was less on testing the API and more to show an example of how that could be used by a client |
Collaborator
Author
|
Ah! Okay, I'll come back to this once we wrapped up the review on the ROOT side with Vincenzo |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cppjit is a Python extension library, not an embedding library. Remove the PyConfig/Py_InitializeFromConfig fallback from cpyrt's private Initialize() and let it fail gracefully when the interpreter was not initialized by the embedding application, instead of initializing a bare interpreter from inside an extension module.
Along the same boundary, move the "access to the python interpreter" functions out of cpyrt entirely: Import(), Exec(), ExecScript() and Prompt() use none of cppjit's proxy machinery. Also drops the gMainDict bookkeeping they depended on, and exposes the extension module itself via GetThisModule() for an embedding framework to attach imported modules to.