[Python-ideas] python3: subtle change to new input()
Terry Reedy
tjreedy at udel.edu
Wed Nov 14 22:43:44 CET 2007
"Christian Heimes" <lists at cheimes.de> wrote in
message news:473B1AFA.7080900 at cheimes.de...
| I think it's more likely a subtle difference between platforms:
|
| On Linux
| >>> r = input() <CTRL+D>
| Traceback (most recent call last):
| File "<stdin>", line 1, in <module>
| EOFError
| >>> r = input() <CTRL+Z>
| [1]+ Stopped ./python
| $ fg 1
| ./python
| >>>
|
| On Windows
| >>> r = input() <CTRL+D>
| ^D <ENTER>
| >>> r
| '\x04'
| >>> r = input() <CTRL+Z>
| ^Z <ENTER>
| Traceback (most recent call last):
| File "<stdin>", line 1, in <module>
| EOFError
1. Would it be sensibly possible to equalize the behavior? (Your def of
'sensibly'.)
a. ^D and ^Z both raise EOF on all systems.
b. Only ^D on all systems
c. ^D on all systems and ^Z also on Windows.
Would it be a good idea?
For many current Windows users, Python will be the only contact with an
imitation-DOS console window and the need for EOF input, so strict
imitation of old, semi-obsolete DOS mode behavior seems not necesarry.
tjr
More information about the Python-ideas
mailing list