[Edu-sig] The fate of raw_input() in Python 3000

Ian Bicking ianb at colorstudy.com
Fri Sep 8 03:51:46 CEST 2006


dblank at brynmawr.edu wrote:
> I think that we have consensus among (the teachers of edu-sig) that many
> of us rely on the ease-of-use of the input() and raw_input() functions for
> one simple reason: input() and raw_input() can be used on day-1 of class,
> before discussing imports, streams,  strings, eval, or functions. Complete
> replacement solutions require discussions of all of those topics.

I meant to interject a suggestion somewhere, but was only half-tracking 
the thread.  I think a compromise for input() might be possible, that 
only allows for Python literals, but not expressions.  So you could 
input ``1`` and get the number 1, or ``"1"`` and get the string "1", and 
allow lists and all that.  This actually is more featureful than just 
eval(raw_input()), which is all input() does now.


-- 
Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org


More information about the Edu-sig mailing list