Move REPL execution paths to main_modes/repl.py#1817
Merged
rolandwalker merged 1 commit intomainfrom Apr 4, 2026
Merged
Conversation
Motivation: move code out of the monolithic main.py into logical layers. There is no functional change for this refactor, just the creation of main_modes/repl.py and the migration of (some of) the REPL logic out of main.py. There is much more to do, just in relation to the REPL. For example, complete_while_typing_filter() doesn't logically still belong in main.py, but it is bound up with state set in main.py. Likewise, the updates of the prompt string, and similar updates of window title and toolbar, logically belong with the REPL, but are a bit interwoven with other code in main.py. Another desirable change might be migrating the handlers in key_binding_utils.py to repl.py or some new file repl_handlers.py. We might also consider now removing sections of the relatively brittle tests in test_main_regression.py which relate to the REPL, and a note is left to that effect. run_cli() is left in place for now, but the intention is to fully replace it with main_repl().
e616cca to
5c4d3e3
Compare
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.
Description
Motivation: move code out of the monolithic
main.pyinto logical layers.There is no functional change for this refactor, just the creation of
main_modes/repl.pyand the migration of (some of) the REPL logic out ofmain.py.There is much more to do, just in relation to the REPL. For example,
complete_while_typing_filter()doesn't logically still belong inmain.py, but it is bound up with state set inmain.py. Likewise, the updates of the prompt string, and similar updates of window title and toolbar, logically belong with the REPL, but are a bit interwoven with other code inmain.py.Another desirable change might be migrating the handlers in
key_binding_utils.pytorepl.pyor some new filerepl_handlers.py.We might also consider now removing sections of the relatively brittle tests in
test_main_regression.pywhich relate to the REPL, and a note is left to that effect.run_cli()is left in place for now, but the intention is to fully replace it withmain_repl().Checklist
changelog.mdfile.AUTHORSfile (or it's already there).