> Well, StopIteration is still an implementation detail that only > occasionally bleeds through to actual programming. It says nothing about > whether using exceptions for non-exceptional circumstances (control > flow) is good practise. Personally I think it makes the intent of code > less easy to understand - in effect the exceptions *are* being used as a > goto.
The same can be said about if statements and while loops - they are also being used "as gotos". The bad thing about the goto statement is that it allows arbitrary, unstructured control flow. This is unlike if statements, while loops, and - yes - exceptions. They all provide for structured control flow. raise, in particular, is no more evil than break, continue, return, or yield. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com