Common LISP-style closures with Python

Antti J Ylikoski antti.ylikoski at tkk.fi
Mon Feb 6 06:55:50 CET 2012


On 5.2.2012 22:58, Ian Kelly wrote:
> On Sat, Feb 4, 2012 at 9:19 PM, Antti J Ylikoski<antti.ylikoski at tkk.fi>  wrote:
>>> I'm not sure how naughty this is, but the same thing can be done without
>>> using
>>> nonlocal by storing the local state as an attribute of the enclosed
>>> function
>>> object:
>>>
>>> ...
>>
>> Yes, I do know that, but then it would not be a closure :-)))))))))
>
> Sure it is.  Where do you think it looks up the function object?
>
> Cheers,
> Ian

OK, thank you for correcting me.

Andy




More information about the Python-list mailing list