Y
Hacker News
new
|
ask
|
show
|
jobs
by
Iwan-Zotow
1199 days ago
sure it can
1 comments
pasquinelli
1199 days ago
it's been a while since i used python; have lambdas improved? i recall weird restrictions using them, but i can't quite remember what. this was pre puthon 3
link
Iwan-Zotow
1198 days ago
Assignment Expression were added, so you could do
x = 1 y = 2
q = list(map(lambda t: ( tx := t
x, ty := t
y, tx+ty )[-1], [1, 2, 3]))
print(q)
link