[Python-ideas] 'where' statement in Python?

Terry Reedy tjreedy at udel.edu
Thu Jul 22 04:12:49 CEST 2010


On 7/21/2010 7:20 AM, Nick Coghlan wrote:

> yield and return (at the level of the given clause itself) will need
> to be disallowed explicitly by the compiler

Why introduce an inconsistency?

If

a = e1
b = f(a)

can be flipped to

b = f(a) given:
     a = e1

I would expect

a = e1
return f(a)

to be flippable to

return f(a) given
     a = e1

-- 
Terry Jan Reedy




More information about the Python-ideas mailing list