I added two attributes: a current line number and the file name, that make
it much easier for parsers to produce useful error messages (yeah, you can
write a single parser that keeps track of line numbers, but wait until you
try to write a parser class), and I added a number of methods for
looking ahead at lines in the file.
f.peekline() - peek the next unpeeked line
f.peeklinen() - peek the nth unread line
f.peekreset() - make all unread lines unpeeked
This stuff has made it very much easier for me to parse line-oriented input,
but psuedo-classes are too slow, so I'm planning to reimplement these methods
on C for fileobjects, which is where I think they belong.
Anyone else interested? Guido?