[Python-Dev] statically nested scopes

Guido van Rossum guido@python.org
Wed, 01 Nov 2000 22:29:03 -0500


> It may not look serious, but changing the Python lookup scheme
> is, since many inspection tools rely and reimplement exactly
> that scheme. With nested scopes, there would be next to no
> way to emulate the lookups using these tools.

So fix the tools.

> To be honest, I don't think static nested scopes buy us all that
> much. You can do the same now, by using keyword arguments which
> isn't all that nice, but works great and makes the scope clearly
> visible.

Yes.  It's a hack that gets employed over and over.  And it has
certain problems.  We added 'import as' to get rid of a common
practice that was perceived unclean.  Maybe we should support nested
scopes to get rid of another unclean common practice?

I'm not saying that we definitely should add this to 2.1 (there's
enough on our plate already) but we should at least consider it, and
now that we have cycle GC, the major argument against it (that it
causes cycles) is gone...

--Guido van Rossum (home page: http://www.python.org/~guido/)