How to name Exceptions that aren't Errors
Aahz
aahz at pythoncraft.com
Thu Apr 7 17:19:30 EDT 2005
In article <3blfl8F6gt80jU1 at individual.net>,
Leo Breebaart <leo at lspace.org> wrote:
>
>My question is twofold. First, I know that many programmers are
>violently opposed to using exceptions in this fashion, i.e. for
>anything other than, well, exceptional circumstances. But am I correct
>in thinking that in Python this usage is actually considered quite
>normal, and not frowned upon? Is my snippet above indeed sufficiently
>Pythonic?
Consider the use of StopIteration for ``for`` loops, and you will be
Enlightened.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"The joy of coding Python should be in seeing short, concise, readable
classes that express a lot of action in a small amount of clear code --
not in reams of trivial code that bores the reader to death." --GvR
More information about the Python-list
mailing list