When to use try and except?

Fredrik Lundh fredrik at pythonware.com
Sat Aug 30 08:03:27 CEST 2008


Carl Banks wrote:

> I wouldn't say that the possibility of EAFP in Python makes it
> obsolute to use LBYL.

when using CPython, EAFP at the Python level always involve LBYL at the 
C level.  and it should be obvious to any programmer that checking for 
the same thing twice is quite often a waste of time and resources.

</F>




More information about the Python-list mailing list