[Python-ideas] x=(yield from) confusion [was:Yet another alternative name for yield-from]

Guido van Rossum guido at python.org
Sun Apr 12 02:04:28 CEST 2009


On Sat, Apr 11, 2009 at 4:44 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Nick Coghlan wrote:
>> Since the language reference is actually silent on the topic of caching
>> the bound method when iterating over an object,
>
> Since it's silent about that, if you write a for-loop
> that relies on presence or absence of cacheing behaviour,
> the result is undefined. The behaviour of yield-from
> on the same iterator would also be undefined.
>
> It's meaningless to talk about whether one undefined
> construct has the same semantics as another.

But I wouldn't claim that the language reference being silent means
that it's undefined. If I were asked for a clarification I would say
that caching shouldn't be allowed if it changes the meaning of the
program. Python in general favors *defined* semantics over leaving
things in the gray.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-ideas mailing list