Nested scopes resolution -- you can breathe again!

Russell E. Owen owen at astrono.spamwashington.emu
Fri Feb 23 12:01:19 EST 2001


In article <mailman.982897324.9109.python-list at python.org>, Guido van Rossum <guido at digicool.com> wrote:

>We (PythonLabs) have received a lot of flak over our plan to introduce
>nested scopes despite the fact that it appears to break a small but
>significant amount of working code.

I'm unhappy about the plan not because of potentially broken old code, but because it's not as clean as it might be. There are some unfortunate exceptions (such as classes) and it seems a bit more dangerous in Python than in other languages because of Python's lack of requirement to declare variables. A mis-typed variable name may accidentally refer to a variable instead of just creating a new local variable -- a bad bug becomes a worse bug.

I think I am not the only one.

So what I'm saying, at the risk of giving offense, is I'd rather wait and have a cleaner implementation. In a posting yesterday I suggested considering scaling back the proposal to allow it to be simpler and more regular, for example have a keyword or other explicit notation to say "this variable is not in local scope". One person replied with a notation that sounded interesting.

Thank you for the many wonderful enhancements in 2.0. Lots of nice changes in there to make a programmer's life easier. An outstanding upgrade to a great language!

-- Russell



More information about the Python-list mailing list