Author terry.reedy
Recipients Zero, rhettinger, taleinat, terry.reedy
Date 2019-11-02.02:59:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
My previous response was to comments up to msg355812.

To answer Raymond's subsequent questions: The user will enter python code the same as before.  Currently, the indents and resulting appearance of the code on Shell screen is different from (and worse, sometimes far worse, than) the appearance of the same code in the REPL.  After this patch *and* a required immediate follow-up to replace tab indents with, by default, 4-space indents, the code on the screen *and in saved sessions* will appear the same as in the REPL (when 4-space indents are used).

In Tal's screenshot, the appearance is better, but the indents are still tabs.  Because of the regression being fixed by #38636, PR 17008, he could not manually switch with alt-T and alt-U.

(The current sidebar patch is also missing output markers.  Also, for my custom dark theme, I colored the sidebar dark blue on light bluish gray and the result, to me, is aesthetically much more pleasing than in the screenshot.)

The improvement is, to me, even more evident in the following pair of examples -- first REPL and improved IDLE, second current IDLE. 

>>> if True:
...     print('true')
... else:
...     print('false')


>>> if True:

#7676 was marked as a bugfix issue and I regard changing examples like the above to be a long-overdue and badly needed fix.  Any version that does not get this fix will also not get followup changes.  I just added msg355853 to #37892 to list some I have thought of.

One of my intended followups is to add multiple ways of saving a shell session.  IDLE can juggle prompts/markers, code, and output to match 'templates' much easier than users can.  I had not thought about doctests, but saving shell interaction in the proper format should be an easy addition.

SyntaxErrors aside, output will be the same as it is in IDLE now, with 'Out', 'Err', and maybe 'Inp' markers ('Imp' for user code input(prompt) lines) planned for the sidebar.

IDLE already handles syntax errors in the code being entered differently from the REPL by replacing the caret line with an error highlight, as in the editor.  I would like it follow the logic of not imitating dumb terminals by putting the cursor at the marked spot, as in the editor, and letting the user directly correct the problem.  Messing up the input with a usually useless traceback and a new prompt and requiring retrieval of the statement with the marker removed and the cursor in the wrong place is a nuisance.  I also don't see any reason to burden the session history with bad code that was never submitted for execution.  (Note that IDLE does not RESTART when code in the editor has syntax errors.)
Date User Action Args
2019-11-02 02:59:23terry.reedysetrecipients: + terry.reedy, rhettinger, taleinat, Zero
2019-11-02 02:59:23terry.reedysetmessageid: <>
2019-11-02 02:59:23terry.reedylinkissue37903 messages
2019-11-02 02:59:22terry.reedycreate