On 28 Mar 2002 at 8:29, Guido van Rossum wrote:
One other, more practical reason to like the rule: "except Exception:" would become equivalent to "except:". The advantage is that you can then write "except Exception, e:" and catch the exception instance in a local variable without having to call sys.exc_info().
Which, to my mind, is sufficient to justify the rule.
Hmm. If the rule were (eventually) strictly enforced, could we get the C++-style "stack allocated object whose destructor releases the resource" trick working?
(Which would allow killing off the recurrent "with" / "using" thread.)
-- Gordon http://www.mcmillan-inc.com/