[issue23616] Idle: conflict between loop execution and undo shortcut.

Terry J. Reedy report at bugs.python.org
Mon Mar 9 21:01:31 CET 2015


Terry J. Reedy added the comment:

I believe you are reporting the following behavior, which I believe I have seen before but which seems not to be the subject of a tracker issue.  If I run

import time
for i in range(20):
	print(i)
	time.sleep(.5)

either in Shell at >>> or from the editor, and hold Undo (^Z for me on Windows), output is deleted back to the previous >>>.  When the statements are enter in Shell, that means erasing the visible 'for' statement.  A bit to my surprise, <<Prev>> (alt-P for me) still reloads the 'for' statement.

While this behavior is entirely avoidable by users (don't hit Undo after Enter), I agree that it is not desirable.  At minimum, it should be possible to clear the undo buffer when code is submitted for execution, just as it is when >>> is printed.  That should prevent removal of the entered statement.

I believe Undo is left active during execution so it will be active during user entry in response to input('prompt').  Also, one can start entering input before 'prompt' is printed. So avoiding adding output to Undo would be trickier.

--
Please don't fiddle with the Versions: settings.  This is not a security issue, any change will be applied to 3.5.

----------
versions: +Python 3.5 -Python 3.2, Python 3.3

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


More information about the Python-bugs-list mailing list