Fernando Perez wrote:
> there are a couple of threads on lambdas today, which got me curious about
> their differences as far as bytecode goes:
>
> planck[~]|2> lf=lambda x: x**2
> planck[~]|3> def ff(x): return x**2
> |.>
> planck[~]|4> import dis
> planck[~]|5> dis.dis(lf)
> 1
Erik Max Francis wrote:
> Fernando Perez wrote:
>
>> Can someone explain to me what the extra two bytecodes at the end of the
>> function version (ff) are for?
>>
>> This is just curiosity, please note that I am NOT making any arguments pro
>> or against lambdas, functions or anything else.
>
>
Fernando Perez wrote:
Can someone explain to me what the extra two bytecodes at the end of the
function version (ff) are for?
This is just curiosity, please note that I am NOT making any arguments pro or
against lambdas, functions or anything else.
It's returning None. I would guess that it's a sa
Hi all,
there are a couple of threads on lambdas today, which got me curious about
their differences as far as bytecode goes:
planck[~]|2> lf=lambda x: x**2
planck[~]|3> def ff(x): return x**2
|.>
planck[~]|4> import dis
planck[~]|5> dis.dis(lf)
1 0 LOAD_FAST0