On 9 November 2011 23:11, Guido van Rossum wrote:
> On Wed, Nov 9, 2011 at 2:13 PM, Greg Ewing
> wrote:
>> In my current grammar, it's a syntax error on its own,
>> but 'f(yield from x, y)' parses as 'f((yield from x), y)',
>> which seems like a reasonable interpretation to me.
>
> Once you real
On 10/11/11 14:50, Nick Coghlan wrote:
I'd actually be amenable to making it legal to omit
the extra parentheses for both yield& yield from in the single
argument case where there's no ambiguity...
>
The way your patch tried to do it also allowed "f(yield
from x, 1)" which strikes me as being
On Thu, Nov 10, 2011 at 10:35 AM, Greg Ewing
wrote:
> On 10/11/11 11:43, Tim Delaney wrote:
>>
>> We have precedent for being more restrictive initially, and relaxing those
>> restrictions later.
>>
>> I suggest that the more restrictive implementation go in now so that
>> people
>> can start play
On 10/11/11 11:43, Tim Delaney wrote:
We have precedent for being more restrictive initially, and relaxing those
restrictions later.
I suggest that the more restrictive implementation go in now so that people
can start playing with it. If the discussion comes to a consensus on more
relaxed synta
On 10/11/11 12:11, Guido van Rossum wrote:
Actually it is valid, meaning "yield (expr, expr)" in any context
where "yield expr" is valid
Hmmm, it seems you're right. I was testing it using my patched
yield-from version of Python, where it has apparently become a
syntax error. I didn't mean to
On Wed, Nov 9, 2011 at 2:13 PM, Greg Ewing wrote:
> Guido van Rossum wrote:
>>
>> I see this as inevitable. By the time the parser sees 'yield' it has
>> made its choices; the 'from' keyword cannot modify that. So whenever
>> "yield expr" must be parenthesized, "yield from expr" must too.
>
> This
On 10 November 2011 09:13, Greg Ewing wrote:
> This is patently untrue, because by version of the grammar
> allows 'f(yield from x)', while disallowing 'f(yield x)'.
>
> I made a conscious decision to do that, and I'm a bit alarmed
> at this decision being overridden at the last moment with no
>
Guido van Rossum wrote:
I see this as inevitable. By the time the parser sees 'yield' it has
made its choices; the 'from' keyword cannot modify that. So whenever
"yield expr" must be parenthesized, "yield from expr" must too.
This is patently untrue, because by version of the grammar
allows 'f(
I see this as inevitable. By the time the parser sees 'yield' it has
made its choices; the 'from' keyword cannot modify that. So whenever
"yield expr" must be parenthesized, "yield from expr" must too. (And
yes, there are parsing systems that don't have this restriction. But
Python's does and we li
On Wed, Nov 9, 2011 at 8:59 PM, Greg Ewing wrote:
> Nick Coghlan wrote:
>> I'll add a new test to ensure "yield from x" requires parentheses whenever
>> "yield x" requires them (and fix the Grammar file on the implementation
>> branch
>> accordingly).
>
> Wait a minute, there's nothing in the PEP
Nick Coghlan wrote:
In reviewing Zbyszek's doc updates and comparing them against the Grammar, I
discovered a gratuitous change in the implementation: it allows a bare (i.e. no
parentheses) 'yield from' as an argument to a function.
I'll add a new test to ensure "yield from x" requires parenthe
11 matches
Mail list logo