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.
feat: Add support for REPLs #2723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for REPLs #2723
Changes from all commits
34cd838
d0dce4f
06cef67
6c2dd35
fc9cdeb
a2be313
f6dc039
b0b83ab
402faf5
66d216d
ac5d58c
9c9c8b0
1d3de79
d8b1125
e05f9af
9121abd
8635890
8a00d32
d48433b
2aa2a27
2c6f544
200e5e8
5f46437
98064dc
0ae8a81
32c436e
863e970
b769fb1
44dda2f
d9bed35
f1a68ab
520c980
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also copy the logic for the banner, so that users are greeted with the familiar Python version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
That is actually surprisingly awkward. That code is implemented a few times. At least once in the cpython startup code and once in the
code
module. Since there's no good way to invoke either of those from here, I did indeed end up copying it. Let me know if this is what you had in mind.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, did not realize it was a little awkward, but thanks for doing it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I remember @rickeylev mentioning to avoid
out
parameters because then we can use providers to pass the files around more cleverly. I think the_generate_repl_main
could do that, but if you disagree on this approach, then it is fine to leave as is here for now.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
It did make the filename a bit weird though. Instead of
repl.py
, it's now calledrepl_py.py
. Will have to ask Richard about that. Unless I misunderstood what you had in mind, apologies.