[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-27 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-27 Thread Terry J. Reedy
Change by Terry J. Reedy : -- type: -> enhancement versions: +Python 3.9 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-26 Thread Arne Recknagel
Arne Recknagel added the comment: Alright, fair enough -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-26 Thread Guido van Rossum
Guido van Rossum added the comment: I beg to differ. The rule I use is: If it doesn't work without parentheses, try adding them. That's simple rnough. -- ___ Python tracker

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-26 Thread Arne Recknagel
Arne Recknagel added the comment: I'll keep shouting from the sidelines, if it's ok. Is the following behavior still desired >>> [z := x for x in 'foo'] # valid over forcing parentheses here as well? >>> [(z := x) for x in 'foo'] # also valid, but redundant parentheses The section on

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-25 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: IIRC there was a debate over allowing top level assignment expression without parentheses in original PEP 572 issue and most of the docs and examples follow using parentheses to avoid this confusion. I just noticed while reading the PEP that list

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-25 Thread Guido van Rossum
Guido van Rossum added the comment: @xtreak do you think we need to keep this issue open then? -- ___ Python tracker ___ ___

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-25 Thread Arne Recknagel
Arne Recknagel added the comment: Nothing in particular, only that I expected it to follow the same rules as regular if-blocks. It would be nice to have, since it'd be one less thing to keep in mind. > There are some tricky issues in this particular bit of syntax [...] It looks like there

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-25 Thread Guido van Rossum
Guido van Rossum added the comment: We're intentionally holding back on the places where we allow unparenthesized walrus operators. There are some tricky issues in this particular bit of syntax -- look at this line in the grammar:

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-25 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38277] Allowing conditions with assignment expressions in comprehensions without parantheses

2019-09-25 Thread Arne Recknagel
New submission from Arne Recknagel : All code is run on python build from the current 3.8 branch. The following doesn't work: >>> [x for x in 'foo' if y := True] File "", line 1 [x for x in 'foo' if y := True] ^ SyntaxError: invalid syntax While