[Python-Dev] metaclass insanity

Kevin Jacobs jacobs@penguin.theopalgroup.com
Tue, 5 Nov 2002 11:59:10 -0500 (EST)


On Tue, 5 Nov 2002, Guido van Rossum wrote:
> > > I don't think it makes much sense to call all Python functions
> > > closures.
> > 
> > I was taught that a closure is a first class function or object that
> > holds references to its own lexically defined namespace(s).  So as I
> > understand it, they _are_ closures, though limited to only two
> > levels of lexical scope (or three if you count the builtin scope).
> 
> You're behind the times.  Python 2.2 (and 2.1 if you did "from
> __future__ import namesepaces") allows references to outer functions
> as well.

I thought there were still a limited number of levels of true lexical scope,
but it seems that I'm wrong.  Cool!

-Kevin


--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19         E-mail: jacobs@theopalgroup.com
Fax:   (216) 986-0714              WWW:    http://www.theopalgroup.com