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

Michael Hudson mwh21 at cam.ac.uk
Tue Jun 22 16:02:12 EDT 1999


"Jesse D. Sightler" <jsight at mindspring.com> writes:

> 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.

Well, every for loop terminates with an IndexError exception...  But
yes, it does make a mockery of the name.

The performance of exceptions in Python isn't really a concern, if
you're coming from C++ where exceptions can take thousands of times
longer than normal function returns.

> I really do not like this idea.  :)
> 

No, me neither. Oh well, each to their own.
M




More information about the Python-list mailing list