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
I've done a bit more reading, and have realized one other important thing no one has mentioned yet: in Python, there is no distinction between Errors and Exceptions. I knew this, but I don't think I had grasped the significance until now.
In PHP, you can wrap $page->GetContent(); in try...catch blocks all you want, but if $page is not an object, your application will still come to a screeching halt with the resulting fatal error. So in PHP (and any other language where errors cannot be caught), you need a certain level of LBYL.
Python basically says, "that's stupid, I should be able to catch those." Just try to do what you need to do, and deal with any fallout in the except block.
Here is a great article on exception handling I came across.