4 ms·
For those interested in the REPL improvements: " Python now uses a new interactive shell by default, based on code from the PyPy project. When the user starts
by underdeserver 2y ago
For those interested in the REPL improvements:
"
Python now uses a new interactive shell by default, based on code from the PyPy project. When the user starts the REPL from an interactive terminal, the following new features are now supported:
Multiline editing with history preservation.
Direct support for REPL-specific commands like help, exit, and quit, without the need to call them as functions.
Prompts and tracebacks with color enabled by default.
Interactive help browsing using F1 with a separate command history.
History browsing using F2 that skips output as well as the >>> and … prompts.
“Paste mode” with F3 that makes pasting larger blocks of code easier (press F3 again to return to the regular prompt).
"
Sounds cool. Definitely need the history feature, for the few times I can't run IPython.
- user070223 2y agoThanks, I just found out about .pythonstartup and setup writing history to a file and pretty printing with pprint / rich. https://www.bitecode.dev/p/happiness-is-a-good-pythonstartup https://www.bitecode.dev/p/happiness-is-a-good-pythonstartup or search for a gist
- formerly_proven 2y agoPresumably this also means readline (GPL) is no longer required to have any line editing beyond what a canonical-mode terminal does by itself. It seems like there is code to support libedit (BSD), but I've never managed to make Python's build system detect it.
- zvr 2y agoI have managed to build Python with libedit instead of readline, but it was a custom build. If your assumption is correct, then I'm anxiously waiting for having the default Python executable in Ubuntu, for example, being licensed under a non-copyleft license. Then one would be able to build proprietary-licensed executables via PyInstaller much more easily.
- mixmastamyk 2y agoI hope it doesn’t break ptpython, and/or is worse than it. I’ve been using it for quite a while.
- faizshah 2y agoI don’t think they added autocomplete support so PtPython is still better.
- cmdlineluser 2y agoNo vi editing mode :-( > The new REPL will not be implementing inputrc support, and consequently there won't be a vi editing mode. https://github.com/python/cpython/issues/118840#issuecomment-2122961403 https://github.com/python/cpython/issues/118840#issuecomment...
- EasyMark 2y agoiPython is a much better repl anyway, use that, it has a vi mode