Terry J. Reedy <tjre...@udel.edu> added the comment:

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')

versus

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

#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.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37903>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to