Anselm Kiefner <amogor...@gmail.com> added the comment:

I just stumbled over this same restriction and when I googled for "SyntaxError: 
cannot assign to named expression", 0 actual results showed - an absolute 
unicorn for a Python error.

> "Due to design constraints in the reference implementation (the symbol table 
> analyser cannot easily detect when names are re-used between the leftmost 
> comprehension iterable expression and the rest of the comprehension), named 
> expressions are disallowed entirely as part of comprehension iterable 
> expressions (the part after each "in", and before any subsequent "if" or 
> "for" keyword):"

Might the new PEG parser maybe help alleviate this restriction, so we could 
declare this a bug instead?

----------
nosy: +Anselm Kiefner

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

Reply via email to