A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-September/038044.html below:

[Python-Dev] pre-PEP: Resource-Release Support for Generators

[Python-Dev] pre-PEP: Resource-Release Support for Generators [Python-Dev] pre-PEP: Resource-Release Support for GeneratorsArmin Rigo arigo at tunes.org
Mon Sep 15 06:48:36 EDT 2003
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


More information about the Python-Dev mailing list

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