Toby Dickenson wrote:
On Friday 04 Oct 2002 1:18 pm, Guido van Rossum wrote:
To make it worse when this is sometimes done for a large stretch of code, even though there are only a few specific spots where the exception is expected.
The idiom of putting this long stretch of code into and 'else' block after the 'try' block is underused, and not just in Zope. I wonder why?
I think it's because its syntax is out of order. :-) Whenever I'm about to write a "try...except...else" block, I really want to spell it "try...else...except". This places the exceptional situation after the common situation, where it should be. Unfortunately the word "else" has too narrow a meaning to allow this, so I wouldn't recommend it actually be done. :-) Shane