On Fri, Feb 01, 2019 at 09:31:21PM +0100, Oleg Broytman wrote:

>    Python REPL is missing the following batteries:
> 
> * Persistent history;

On Linux/Unix systems, that has been available for about 18+ years, 
since the rlcompleter module was introduced in Python 2.0:

https://docs.python.org/release/2.0/lib/module-rlcompleter.html

It's been automatically enabled for more than six years:

https://hg.python.org/cpython/rev/d5ef330bac50

Windows is another story.


> * Syntax highlighting;

bpython provides syntax highlighting in the REPL, but I've never seen 
the point. In an editor, perhaps, but why bother in the REPL?

https://bpython-interpreter.org/

So does DreamPie:

http://www.dreampie.org/



> * Clear separation (using, for example, different colors)
>   between input, output and errors;

Input always starts with a prompt; exception tracebacks always start 
with the line "Traceback..."; other errors are generally not 
programmatically distinguishable from non-errors.

One could modify the displayhook and excepthook to deal with the usual 
cases, but colour codes are not just platform-specific but console- 
specific.

https://docs.python.org/3.5/library/sys.html#sys.displayhook

https://docs.python.org/3.5/library/sys.html#sys.excepthook


> * Paging of very long output/errors.

I don't know how I feel about that. Now that Python shrinks long 
tracebacks filled with identical lines, I'm not sure that this is so 
important or desirable.

>>> import sys
>>> sys.setrecursionlimit(30)
>>> def spam():
...     spam()
...
>>> spam()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in spam
  File "<stdin>", line 2, in spam
  File "<stdin>", line 2, in spam
  [Previous line repeated 26 more times]
RecursionError: maximum recursion depth exceeded



-- 
Steve
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to