Hello Samuele, On Sat, Sep 13, 2003 at 04:18: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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4