[Python-Dev] Extended Function syntax

Michael Hudson mwh@python.net
Mon, 03 Feb 2003 10:44:44 +0000


Brett Cannon <bac@OCF.Berkeley.EDU> writes:

> Now if ``__exit__()`` would be executed regardless of exceptions this
> would probably eliminate a decent chunk of code that uses ``finally:``
> such as::

That was the major point of the proposal.  Holger has a Friendly
Competing Proposal that I think allows the "monitor" (i.e. the thing
with the __enter__ and __exit__ methods) to distinguish between normal
and exceptional return.  I thought that was a bit overcomplicated.

Cheers,
M.

-- 
[1] If you're lost in the woods, just bury some fibre in the ground
    carrying data. Fairly soon a JCB will be along to cut it for you
    - follow the JCB back to civilsation/hitch a lift.
                                               -- Simon Burr, cam.misc