The rap against "while True:" loops

Aahz aahz at pythoncraft.com
Fri Oct 16 15:07:08 EDT 2009


In article <mailman.1540.1255714251.2807.python-list at python.org>,
Tim Rowe  <digitig at gmail.com> wrote:
>
>The understood meaning of throwing an exception is to say "something
>happened that shouldn't have". If one uses it when something has
>happened that *should* have, because it happens to have the right
>behaviour (even if the overhead doesn't matter), then one is
>misrepresenting the program logic.

Except, of course, that your "understood meaning" is wrong for Python.
Perhaps you should go look up StopIteration.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"To me vi is Zen.  To use vi is to practice zen.  Every command is a
koan.  Profound to the user, unintelligible to the uninitiated.  You
discover truth everytime you use it."  --reddy at lion.austin.ibm.com



More information about the Python-list mailing list