YAS to the "Reading line-by-line" Problem

Hans Nowak ivnowa at hvision.nl
Tue Jun 22 16:45:22 EDT 1999


On 22 Jun 99, Jesse D. Sightler wrote:

> Ack is raising an exception for a normally occuring event really a
> _good_ idea?  Generally exceptions are only used for things that
> actually are error conditions, and it would seem to me that using them
> as nothing more than a fancy flow-control construct is a sure path to
> nasty spaghetti code.
> 
> I really do not like this idea.  :)

Hmm, I always wanted file objects to have an eof() method... I never 
quite understood why it isn't there. Assuming file objects are based 
on C's fopen, fclose, fread etc. functions, it puzzles me why feof 
wasn't used as well.

Of course I could write another file object to do this... but it's 
not a big deal, really. I just wondered. :)

--Hans Nowak (ivnowa at hvision.nl)
Homepage: http://fly.to/zephyrfalcon




More information about the Python-list mailing list