Nick Coghlan wrote:
> The whole PEP draft can be found here:
> http://members.iinet.net.au/~ncoghlan/public/pep-3XX.html

I've updated this based on the feedback so far. The biggest change is that I've 
dropped the 'del' idea in favour of an optional 'finally' clause on for loops 
that finalises the iterator in addition to executing the code contained in the 
clause.

I also added additional description of the purpose of user defined statements 
(factoring out exception handling boilerplate that is not easily factored into 
a 
separate function), and fixed the semantics so that __exit__() is called 
without 
an argument when the statement exits cleanly (previously, a template could not 
tell if the statement exited cleanly or not).

I expanded on the generator section, indicating that the __exit__ method simply 
invokes next() if no exception is passed in (this makes the transaction example 
work correctly).

I updated the auto_retry example to work with the new for loop finalisation 
approach, and added an example (reading the lines from multiple named files) 
where timely iterator finalisation is needed.

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.blogspot.com
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to