I have it drilled into my head that (at least in PHP) it is badbadmojo to use try... catch
blocks for flow control. What I\'ve learned is to use them only to h
To answer the question: Yes. Python exceptions are cheap. An if test is cheaper still, so yes, you should just use exceptions for "unexpected" situations, in as much as if you expect the code to fail most times, check before you do it. Since the if-check will avoid also the actual trying as well as the raising and catching of the exception, that will be much faster in a situation that fails. (Unless, of course, the test in itself is expensive).
But there is no point in avoiding exceptions as such. Python will not drag to a crawl because you catch a lot of exceptions.
And as usual: Optimization without profiling is premature.