Author terry.reedy
Recipients Jim Fasarakis-Hilliard, brett.cannon, terry.reedy, xoviat
Date 2017-01-23.21:30:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The point I was trying to get at above is that simply printing a prompt and making the use enter the entire line should work on every console, while anything fancier may not be so reliable.  Thinking more, I realize that my patch outline is incomplete. After 'line = input(prompt + indent)', line will not include the indent. A printed indent will have to be added to the input received from the user.  (In IDLE's Shell and editors, the indents that IDLE insert()s into a text widget are indistinguishable from those types by a user and *are* included in the user input that IDLE reads.)  An associated issue is that cross-platform automated tests would be difficult to impossible.

More experiment reveals the fatal problem: in REPL mode, python reads stdin and writes to stdout and stderr.  In the Windows console, and I am sure others, printed output cannot be deleted.  In particular, printed input spaces, such as the one at the end of '>>> ' cannot be deleted.  So dedenting, as in the following example, would not be possible.  One cannot input() a negative string.

if possible:
    print('I like it')
    print('too bad')

So unless I am wrong, the idea must be rejected.
Date User Action Args
2017-01-23 21:30:20terry.reedysetrecipients: + terry.reedy, brett.cannon, Jim Fasarakis-Hilliard, xoviat
2017-01-23 21:30:20terry.reedysetmessageid: <>
2017-01-23 21:30:20terry.reedylinkissue29339 messages
2017-01-23 21:30:20terry.reedycreate