Function decorator that caches function results

Steven D'Aprano steve at REMOVETHIScyber.com.au
Sun Oct 9 14:16:03 EDT 2005


On Sun, 09 Oct 2005 17:39:23 +0200, Fredrik Lundh wrote:

> only if you're obsessed with CPython implementation details.

No. I'm obsessed with finding out what closures are, since nobody seems to
have a good definition of them!

However, I have learnt some things: closures are something which functions
HAVE, not ARE. The func_closure attribute is just part of the
implementation of the closure. Some languages have closures and some
don't. And a closure is something that lets a function object access the
lexical scope that existed when the function object was created, e.g. the
namespace of the function which created it.

Am I getting there now?


-- 
Steven
who is very grateful for the time folks have taken to explain this.




More information about the Python-list mailing list