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/2005-May/053913.html below:

[Python-Dev] PEP 343 - New kind of yield statement?

[Python-Dev] PEP 343 - New kind of yield statement? [Python-Dev] PEP 343 - New kind of yield statement?Paul Moore p.f.moore at gmail.com
Thu May 19 13:54:29 CEST 2005
On 5/19/05, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Michael Hudson wrote:
> 
> > This is, to me, neat and clear.  I don't find the idea that iterators
> > are tied to exactly 1 for loop an improvement (even though they
> > usually will be).
> 
> To fix this in a fully backward-compatible way, we
> need some way of distinguishing generators that
> expect to be finalized.

I don't see anything that needs to be "fixed" here. Sure, generators
that expect to be finalised will not be finalised simply by the fact
that a for loop exits, but that's fine - it's not part of the spec of
a for loop that it does finalise the generator. Adding that guarantee
to a for loop is a change in spec, not a fix.

Paul.
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