Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-111201: A new Python REPL#111567
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
gh-111201: A new Python REPL#111567
Changes from1 commit
Commits
Show all changes
88 commits Select commitHold shift + click to select a range
2bf1505
gh-111201: A new Python REPL
pablogsal35d322e
Clean some files
pablogsal4d2303b
Fix history across sessions
pablogsal7763c05
Fore fixes to history
pablogsale85d873
Lukasz was wrong all along
pablogsal842496e
Implement REPL commands and remove F1 for help (curses shows that scr…
pablogsal1417b9b
Restore F1 for help
pablogsal4c69853
Implement colored prompt
pablogsal359407b
WIP for paste mode
pablogsal85a2b35
Only execute PYTHONSTARTUP when asked (we do it in main.c anyway)
ambv05a8831
Fixed coloring
pablogsalc074ca6
Do not run commands if they are shadowed
pablogsal9584b5b
Move pager routines to _pyrepl, so we can use it in the REPL without …
ambvd7ddebd
Don't assume stupid paths or you will be tested against your stupid a…
ambv2d24cd2
<F2> shows history so you can copy it, <F3> is paste mode
ambvfe1b3ac
Do not include REPL commands in history
pablogsale1abd39
Add Blurb
ambvafbeaab
Reintroduce old names to fix pydoc tests
ambvaee9fcf
Add some tests
pablogsal77db960
Add moar tests
pablogsal2a64680
Add moar tests
pablogsal5bced59
Cleanup and refactor
pablogsal20533d3
Refactor unix_console.py
pablogsala07a0ce
Refactor unix_console.py more
pablogsalb8b0e76
Refactor unix_console.py more
pablogsalc570171
Moar tests
pablogsal169043f
Fix test___all__
ambvc613ae3
Fix test_traceback
ambv98fbee2
Fix weird r-search scrambled text due to color codes
pablogsal254aaf2
Fix weird r-search scrambled text due to color codes better
pablogsalcf9bd26
Disgusting fix for help state restoration
pablogsalb064e1f
Test pasting with/without paste mode
mgmacias950fa01e0
refactor events
mgmacias95fa37b07
Merge pull request #71 from mgmacias95/pyrepl
pablogsala6d54e6
help() uses its own history, doesn't pollute main history
ambvffbf24b
Add typing to reader.py
ambv6c188fb
Add types to pager.py
ambv7919bae
Add types to input.py, console.pu, and commands.py
ambv2a7e81d
Refactor termios stuff in unix console
lysnikolaouaa9eaf3
Merge pull request #72 from lysnikolaou/pyrepl-refactor-term-unix-con…
pablogsal8c368d0
Revert "Refactor termios stuff in unix console"
pablogsal977e79e
Fix cursor position for double-width characters
lysnikolaou05b1142
Add _pyrepl to installed Lib subdirs
lysnikolaouc56209a
Merge pull request #74 from lysnikolaou/pyrepl-add-module-install
pablogsalbc31d3a
Add tests
lysnikolaou373a8a0
Update Lib/test/test_pyrepl.py
pablogsale9be872
Merge pull request #73 from lysnikolaou/pyrepl-double-width-char-cursor
pablogsalcba260f
Implement better fallback with PYTHON_OLD_REPL
pablogsal233da02
Cache failures in pyrepl
pablogsal07695f7
Stay at eol when moving up/down
lysnikolaou63dabfd
Fix linter
lysnikolaou162252a
fix early errors
pablogsal970fd85
Fix CI
pablogsal3dcf704
Fix paste mode when there are empty line in the middle
lysnikolaou755728d
Fix disp_str for control characters
lysnikolaou121ce2b
Fix mac CI
pablogsal07345da
Merge pull request #77 from lysnikolaou/pyrepl-fix-disp-str-ctrl
pablogsale5154d2
Merge pull request #76 from lysnikolaou/pyrepl-paste-mode-newlines-mid
pablogsal390d778
Merge pull request #75 from lysnikolaou/pyrepl-eol-move-up-down
pablogsalba26254
Various fixes to handle wide characters correctly
lysnikolaou691c75e
Fix vertical navigation with wide characters
lysnikolaou9804074
Write more tests
lysnikolaou8f3e713
Fix backspace in second line
lysnikolaouabe9fd3
Fixes for pos2xy & setpos_from_xy when wrapped line
lysnikolaou4f66170
Fix linter & run black
lysnikolaou4bc36ab
Update Lib/_pyrepl/reader.py
pablogsal1443793
Merge pull request #78 from lysnikolaou/pyrepl-various-fixed-wide-cha…
pablogsalb516831
Add typing to consoles
ambv0d24b9d
Merge branch 'main' into pyrepl
ambv18cd2cf
Work around mypy being unhappy with _colorize
ambvafe2513
Remove duplicate test
ambv864ecb8
Add types to HistoricalReader and CompletingReader
ambvb5f8895
Add typing to readline.py
ambv45537bb
Pin test_pyrepl to the `curses` test resource
ambv22c4d3f
Don't call anything curses in test_repl
pablogsal6a0fcef
Many machines on CI run with -uall; skip the test if curses import fails
ambvb4362b5
Fix refleaks
pablogsala900ccd
Document PYTHON_BASIC_REPL
ambv13fda4e
Do not call _setup() on import
pablogsal6ebf89c
Document pyrepl
ambv6d3155e
Merge branch 'main' into pyrepl
ambv058bc7f
Apply suggestions from code review
pablogsal7ac9af8
Update Lib/_pyrepl/_minimal_curses.py
pablogsal7422f1c
Use more specific exceptions
pablogsald2de559
Use better error messages
ambv3053b39
Add to What's New
ambv149658b
Forgot the PyPy attribution in "What's New"
ambvbe2a0c9
let's never talk about this
ambvFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Add to What's New
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit3053b39e6b0274c354c3f56338dba1a5f9abef8a
There are no files selected for viewing
28 changes: 28 additions & 0 deletionsDoc/whatsnew/3.13.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -97,6 +97,34 @@ New typing features: | ||
New Features | ||
============ | ||
A Better Interactive Interpreter | ||
-------------------------------- | ||
On Unix-like systems like Linux or macOS, Python now uses a new | ||
:term:`interactive` shell. When the user starts the :term:`REPL` | ||
from a tty, and both :mod:`curses` and :mod:`readline` are available, | ||
the interactive shell now supports the following new features: | ||
* colorized prompts; | ||
* multiline editing with history preservation; | ||
* interactive help browsing using :kbd:`F1` with a separate command | ||
history; | ||
* history browsing using :kbd:`F2` that skips output as well as the | ||
:term:`>>>` and :term:`...` prompts; | ||
* "paste mode" with :kbd:`F3` that makes pasting larger blocks of code | ||
easier (press :kbd:`F3` again to return to the regular prompt); | ||
* ability to issue REPL-specific commands like :kbd:`help`, :kbd:`exit`, | ||
and :kbd:`quit` without the need to use call parentheses after the | ||
command name. | ||
If the new interactive shell is not desired, it can be disabled via | ||
the :envvar:`PYTHON_BASIC_REPL` environment variable. | ||
For more on interactive mode, see :ref:`tut-interac`. | ||
(Contributed by Pablo Galindo Galgado, Łukasz Langa, and | ||
ambv marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
Lysandros Nikolaou in :gh:`111201`.) | ||
Improved Error Messages | ||
----------------------- | ||
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.