Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

Apparently we currently don't allow walruses in set literals either:

>>> {y := 4, 4**2, 3**3}
  File "<stdin>", line 1
    {y := 4, 4**2, 3**3}
       ^
SyntaxError: invalid syntax

But they should be allowed as well per PEP 572 (as the pep mentions all 
comprehensions):

There is one special case: an assignment expression occurring in a list, set or 
dict comprehension or in a generator expression (below collectively referred to 
as "comprehensions") binds the target in ...

----------

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

Reply via email to