More random python observations from a perl programmer

Hrvoje Niksic hniksic at srce.hr
Tue Sep 14 12:07:47 EDT 1999


"Tim Peters" <tim_one at email.msn.com> writes:

> [Hrvoje Niksic]
> > ...
> > I don't see the purpose of raw_input() and input() when
> > sys.stdin.readline() and eval(sys.stdin.readline()) are available.
> 
> Convenience;

My point exactly.  How often do you really need input()?  Using it to
input numbers is wrong and potentially very dangerous, as shown
before.

I think the additional verbosity of eval(sys.stdin.readline()) is a
very good indication of what is really going on.

> similarly there's no "purpose" to print given that
> sys.stdout.write() is also available.

I find `print' very convenient.  I would find it more convenient if
there were a way for it to print to stderr, though.




More information about the Python-list mailing list