[Python-Dev] PEP 340: syntax suggestion - try opening(filename) as f:

Guido van Rossum gvanrossum at gmail.com
Sat Apr 30 01:19:59 CEST 2005

[Michael Spencer]
> I don't know whether it's true for all the PEP 340 use cases, but the all the
> current examples would read very naturally if the block-template could be
> specified in an extended try statement:

Sorry, this emphasizes the wrong thing. A try-statement emphasizes
that the body may fail (and then provides some cleanup semantics). IMO
a block-statement, while it has cleanup semantics, should emphasize
that the block executes under some kind of supervision.

The more I think about it the more I like having no keyword at all
(see other messages).

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list