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 <[email protected]>
<http://bugs.python.org/issue23616>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com