is there any overheard with try/except statements?

Magnus Lycka lycka at
Fri Mar 10 15:42:11 CET 2006

John Salerno wrote:
> One of the things I learned with C# is that it's always better to handle 
> any errors that might occur within the codes itself (i.e. using if 
> statements, etc. to catch potential out of range indexing) rather than 
> use too many try/catch statements, because there is some overhead every 
> time the program encounters the try.

"Premature optimization is the root of all evil (or at least most of
it) in programming."

More information about the Python-list mailing list