Ronald Oussoren <[email protected]> added the comment:
You can already do this with the walrus operator:
# ---
def test():
for i in range(10):
yield (square := i * i)
yield square + 1
# ---
This adds some parenthesis to your second alternative.
----------
nosy: +ronaldoussoren
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41795>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com