22 Jul 2010 22 Jul '10
On Wed, Jul 21, 2010 at 7:12 PM, Terry Reedy firstname.lastname@example.org wrote:
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?
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
I believe Nick meant returns/yields *within* the `given` suite (he just phrased it awkwardly), e.g.
a = b given: b = 42 return c # WTF
The PEP's Syntax Change section explicitly changes the grammar to allow the sort of `given`s you're talking about.