New submission from Sergei Lebedev <slebe...@google.com>:

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 a list of such changes for 
tooling authors (who might need to support multiple Python versions).

[*]: 
https://github.com/python/cpython/blob/68526fe258da8c01196fd7cf48e8e5f1280bf8fd/Grammar/python.gram#L523

----------
components: Interpreter Core
messages: 377435
nosy: lys.nikolaou, slebedev
priority: normal
severity: normal
status: open
title: PEG parser doesn't allow lambda in for_if_clause
type: behavior
versions: Python 3.10, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41848>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to