Author ronaldoussoren
Recipients conqp, ronaldoussoren
Date 2020-09-16.09:03:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600247009.09.0.467352155066.issue41795@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-09-16 09:03:29ronaldoussorensetrecipients: + ronaldoussoren, conqp
2020-09-16 09:03:29ronaldoussorensetmessageid: <1600247009.09.0.467352155066.issue41795@roundup.psfhosted.org>
2020-09-16 09:03:29ronaldoussorenlinkissue41795 messages
2020-09-16 09:03:29ronaldoussorencreate