[issue41848] PEG parser doesn't allow lambda in for_if_clause

2020-09-26 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, let's close this. -- resolution: -> wont fix stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue41848] PEG parser doesn't allow lambda in for_if_clause

2020-09-26 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I concur with Guido: it makes the grammar slightly more complex for no gain. Also, the originally allowed rule does not allow *any* lambda but only the ones that are simple, which is a special case that makes it even more complex. In any case you can

[issue41848] PEG parser doesn't allow lambda in for_if_clause

2020-09-25 Thread Guido van Rossum
Guido van Rossum added the comment: I propose not to fix this, since it is pointless (a lambda is always truthy). We can call it out in What's New in 3.9 -- as a very small footnote. :-) -- ___ Python tracker

[issue41848] PEG parser doesn't allow lambda in for_if_clause

2020-09-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: After adding parens, >>> [x for x in [] if (lambda: x)] [] -- nosy: +terry.reedy ___ Python tracker ___

[issue41848] PEG parser doesn't allow lambda in for_if_clause

2020-09-24 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- keywords: +patch nosy: +BTaskaya nosy_count: 6.0 -> 7.0 pull_requests: +21434 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22394 ___ Python tracker

[issue41848] PEG parser doesn't allow lambda in for_if_clause

2020-09-24 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +benjamin.peterson, gvanrossum, pablogsal, serhiy.storchaka ___ Python tracker ___ ___

[issue41848] PEG parser doesn't allow lambda in for_if_clause

2020-09-23 Thread Sergei Lebedev
New submission from Sergei Lebedev : Reproducer: [x for x in [] if lambda: x] This parses fine in 3.8, but doesn't parse in 3.9 because the grammar expects a disjunction after if in for_if_clause [*]. While this change has zero practical significance, I think it might be useful to maintain