How "expensive" are Exceptions?

Peter Hansen peter at engcorp.com
Sun Mar 10 22:55:01 EST 2002


Jason Orendorff wrote:
> 
> How do you handle errors in
> C?  You check the return value of every function call.  This
> is what Python does, and it's how Python implements
> exceptions, too.  This is the major cost of exception-handling
> in Python:  checking every return value.  (Good C++ compilers
> cleverly avoid this cost; Python doesn't, alas.)  

Bad C programmers cleverly avoid this cost, too. :-)

-Peter



More information about the Python-list mailing list