Hacker News new | ask | show | jobs
by Iwan-Zotow 1198 days ago
Assignment Expression were added, so you could do

x = 1 y = 2

q = list(map(lambda t: ( tx := tx, ty := ty, tx+ty )[-1], [1, 2, 3]))

print(q)