inline exception handling in python

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Aug 13 01:40:14 EDT 2010


On Thu, 12 Aug 2010 20:08:01 +0200, Thomas Jollans wrote:
[...]
> Besides, more often than not, you want to have a finally clause around
> when you're dealing with exceptions.

Oh I don't know about that. Doing a quick and totally unscientific survey 
of my own code, I find that try...except with no finally outnumbers 
try...finally by about 10 to 1.

In any case, any syntax for inline exception handling should be kept nice 
and lightweight. It shouldn't try to duplicate all the functionality of 
try...except...else...finally blocks.



-- 
Steven



More information about the Python-list mailing list