Nested scopes resolution -- you can breathe again!

Christian Tanzer tanzer at swing.co.at
Fri Feb 23 02:04:56 EST 2001


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.

There were lots of complaints about newly introduced Python features
recently. While I understand concerns about code breakage (myself being
worried about breakage to my code), far more complaints concerned
style issues than breakage.

As I normally don't want to waste time over religious issues -- like
`print >>' being cool or the worst wart ever -- I don't participate in
such discussions on c.l.py.

But IMO Python still is an excellent language and it got even better in the
last year. Thank you and your team for the great work you are doing.

> How do you select nested scopes?  Tim suggested a mechanism that is
> used by the ANSI C committee to enable language features that are
> backwards incompatible: they trigger on the import of a specific
> previously non-existant header file.  (E.g. after #include
> <imaginary.h>, "imaginary" becomes a reserved word.)
> 
> The Python equivalent of this is a magical import that is recognized
> by the compiler; this was also proposed by David Scherer for making
> integer division yield a float.  (See
> http://mail.python.org/pipermail/edu-sig/2000-May/000499.html)  You
> could say that Perl's "use" statement is similar.
> 
> We haven't decided yet which magical import; two proposals are:
> 
>     import __nested_scopes__
>     from __future__ import nested_scopes

Cool.

I hope that `from __future__ import <cool-feature>' will win this
contest -- it defines a common pattern for introducing backwards
incompatible features. 

-- 
Christian Tanzer                                         tanzer at swing.co.at
Glasauergasse 32                                       Tel: +43 1 876 62 36
A-1130 Vienna, Austria                                 Fax: +43 1 877 66 92





More information about the Python-list mailing list