> 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4