[Python-3000] Pre-PEP: Simple input built-in in Python 3000
Phillip J. Eby
pje at telecommunity.com
Fri Dec 22 21:52:02 CET 2006
At 12:20 PM 12/22/2006 -0800, Brett Cannon wrote:
>+1 from me as well, although as Ron suggested, you probably want to
>strip off the newline if we are targetting this to new programmers.
In which case, why not go all the way and use say() and ask()? E.g.:
say('Hello,', ask("What's your name?"))
One benefit of using 'say' instead of 'print' is that 'say' could then be
added to the 2.x line, allowing people to prepare for the switch. (Whereas
print's privileged meaning in 2.x prevents it being used as a function.)
(I don't think calling the function readline() is a good idea if it's going
to strip newlines, btw.)
More information about the Python-3000
mailing list