When Closure get external variable's value?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue Dec 19 13:36:50 EST 2006


In <1166544951.721977.281100 at t46g2000cwa.googlegroups.com>, Huayang Xia
wrote:

> That is a really concise and precise answer. Thanks.
> 
> So the object binding can only happen explicitly at the closure
> declaration argument list(non-free variable).

That's no declaration that's a definition and it happens at runtime!  It's
executed every time the outer function is called and executed and creates
a function object.

As far as I can see you don't create a closure BTW.  You are *calling*
that inner function and return the *result* of that call.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list