Talk:Python Programming/Exceptions

There is no way exceptions should be used for GOTO style programming EVER ... That just smacks of increadiblly bad design ... —Preceding unsigned comment added by 213.86.142.250 (discuss • contribs) 10:05, 26 August 2005

I agree, but the example in the module isn't abusing exceptions as a GOTO statement :-) Thunderbolt16 19:47, 18 September 2005 (UTC)

Another vote for not using exceptions as GOTO statements. They are called exceptions for a reason. You should use if statements and check them correctly instead of arbitrarily running stuff. I haven't looked at how exceptions are actually handled in the python code but they are probably expensive as in other languages. —Preceding unsigned comment added by 71.4.57.161 (discuss • contribs) 23:37, 23 June 2006

Maybe someone could offer wisdom on how much to use exceptions in Python? In C++/Java they are generally used "in exceptional circumstances" and are quite expensive. Does their design in Python lead to more generous use such as filtering inputs in functions rather than returning a default or known error value? —Preceding unsigned comment added by 86.136.239.234 (discuss • contribs) 16:48, 8 October 2005


 * Actually, this style of programming is encouraged in Python, it's called "EAFP". I've removed the "dubious" tag.  --193.11.177.69 (talk) 22:41, 29 August 2009 (UTC)