[issue7676] IDLE shell shouldn't use TABs

Terry J. Reedy report at bugs.python.org
Sun Jul 20 23:51:20 CEST 2014


Terry J. Reedy added the comment:

To continue and expand some things I said in various messages above...

The reason Shell does not and indeed should not have a secondary line prompt is that in Shell, '>>> ' means 'Enter a statement:' rather than just a line. Being able to enter, edit, and recall complete statements rather than just lines is an important feature of Idle's Shell.

For proportional fonts, I suspect the tab stops are every 8 em quads. A em quad (named after M) is square, so it is as wide as the font is high.

In msg151418 I suggested that the solution is to not mix prompts with user input, as is done. I gave the narrow prompt window as fix 3. I suggested as fix 1 to put statement prompts and output indications on separate lines. Here is a mockup example.

>>>:
def f(x):
    if x:
        print('got it')
        return 'something'
>>>:
f(3)
---
got it
>>>:

(The 'blank line' signaling 'end of statement' is intentionally suppressed.) This should be easy to do and, to me, looks pretty decent. The hesitation I had before is the copy for paste problem, but if that is a custom function, it would not be hard to reformat. A minor problem is the output could include '>>>:\n' or '---\n', but today one can do

>>> print(">>> def fake():\n\treturn 'def'\n")
>>> def fake():
	return 'def'

>>>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7676>
_______________________________________


More information about the Python-bugs-list mailing list