[Python-Dev] Merging PEP 310 and PEP 340-redux?

Nick Coghlan ncoghlan at gmail.com
Tue May 10 17:50:02 CEST 2005


Guido van Rossum wrote:
> I used to dislike this, but the opposition and the proliferation of
> alternative proposals have made me realize that I'd rather have this
> (plus "continue EXPR" which will be moved to a separate PEP once I
> have some extra time) than most of the other proposals.

Draft 1.3 of my PEP 310/PEP 340 merger is now up for public consumption:
http://members.iinet.net.au/~ncoghlan/public/pep-3XX.html

This is a major rewrite since version 1.2. Significant changes are:

- reorder and reword things to emphasise the user defined statements, and their 
ability to factor out arbitrary try/except/else/finally boilerplate.
- use 'do' as the keyword instead of 'stmt' (I have to say, I *really* like the 
way 'do' looks and reads in all of the examples)
- clean up the semantics of user defined statements so as to make manual 
statement templates as easy to write as those in PEP 310
- give iterator finalisation its own slot, __finish__() (distinct from the 
__exit__() of statement templates)
- define sensible automatic finalisation semantics for iterative loops
- fill out the Rejected Options section meaningfully, with justifications for 
rejecting certain options
- makes the PEP more self-contained, with significantly fewer references to PEP 340.

These changes try to take into account the feedback I got on the previous 
drafts, as well as fixing a few problems I noticed myself.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.blogspot.com


More information about the Python-Dev mailing list