[Python-Dev] pre-PEP: Resource-Release Support for Generators (original) (raw)
Armin Rigo arigo at tunes.org
Mon Sep 15 06:48:36 EDT 2003
- Previous message: [Python-Dev] pre-PEP: Resource-Release Support for Generators
- Next message: [Python-Dev] pre-PEP: Resource-Release Support for Generators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello Samuele,
On Sat, Sep 13, 2003 at 04🔞51PM +0200, Samuele Pedroni wrote:
OTOH conflating 'with' and 'for' just for generators seems a rather ad-hoc breaking of orthoganility of the two, you could not write anymore code like this:
g = gen() for v in g: ... do something up to a point ... ... for v in g: ...
I had thought about this. This occurs when you 'break' out of the first loop. I would say that NOT calling the exit() method in this specific case seems quite intuitive, the 'break' meaning 'just exit from the loop now without any further processing, skipping the 'else' part if present'.
Armin
- Previous message: [Python-Dev] pre-PEP: Resource-Release Support for Generators
- Next message: [Python-Dev] pre-PEP: Resource-Release Support for Generators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]