kuco23
Aug 1, 2022

--

I think as of python 3.8. there is a hack and you can do e.g. `f = lambda x: (a := x, b := 2*a)` and get `f(10) = (10, 20)`. If you want the last value, just do `f = lambda x: (a := x, b := 2*a)[-1]`.

--

--

kuco23
kuco23

Written by kuco23

Math MSc | Smart contract dev @ Flare network | https://kuco23.github.io

No responses yet