[Python-Dev] fileinput.py

Skip Montanaro skip@mojam.com (Skip Montanaro)
Fri, 5 Jan 2001 13:05:14 -0600 (CST)


    Tim> the-two-people-using-fileinput-should-be-delighted<wink>-ly

What do you think contributes to fileinput's relative disfavor?  This whole
thread on Python's file reading performance was started by the eternal whine
"why is Python so much slower than Perl?" which really means why is

   line = f.readline()
   while line:
      process(line)

so much slower than whatever that thing is in Perl that everybody uses as
the be-all-end-all performance benchmark (something with <> in it).

Given that fileinput is supposed to make the I/O loop in Python more
familiar to those people wandering over from Perl (at least in part), you'd
think that people would naturally gravitate to it.  Would it benefit from
some exposure in the Python tutorial?  Is it fast enough now to warrant the
extra exposure?

just-whining-out-loud-ly y'rs

Skip