[Tutor] A question about input/raw_input

Erik Price erikprice@mac.com
Fri, 19 Apr 2002 17:43:58 -0400


On Friday, April 19, 2002, at 01:24  PM, Jeff Shannon wrote:

> There's currently talk on comp.lang.python about deprecating input(), 
> and possibly
> even removing it from the language, because it *looks* nice and useful, 
> but leads
> to problems as often as not.  (And if someone *really* needs that 
> functionality,
> they could still get it by using eval(raw_input()), but that makes the 
> risks a
> little bit more apparent.)

So is input() really just a shortcut for eval(raw_input()) ?  There's 
really no difference between them?

In that case, it sounds like a good idea to deprecate input().  Apart 
from the danger of using it without realizing its strength (which 
doesn't seem that big a deal to me -- you should always validate input), 
it doesn't seem like this is one of those cases where it's good to have 
two different ways to do something.  eval(raw_input()) is perfectly easy 
to type -- why would anyone really even use input() ?

Thanks for the thoughts Jeff.


Erik