> Note that using exceptions for control flow can be bad for other > implementations of Python. For example exceptions on the .NET framework > are very expensive. Why do you say that? What specific implementation of .NET are you referring to? What do you mean by "very"? > Isn't it better practise for exceptions to be used for exceptional > circumstances rather than for control flow? This is an ongoing debate (in Python, and outside). I'm in the camp that says that exceptions are a control flow mechanism just like loops, conditionals, and recursion. With exceptions, you get essentially multiple alternative outcomes of a function call, rather than just a single result. In principle, it would be possible to eliminate the return statement altogether, but it is useful syntactic sugar. 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