Re:Achieving High-Performance the Functional Way
by pasquinelli on Sunday March 05, 2023 @10:06PM
(#35037074)
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
[ Parent
| on HN ]
Re:Achieving High-Performance the Functional Way
by Iwan-Zotow on Tuesday March 07, 2023 @01:40PM
(#35059263)
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)