[Python-Dev] RE: Nested scopes resolution -- you can breathe again!

Tim Peters tim.one at home.com
Sat Feb 24 23:58:01 EST 2001


[Moshe Zadka]
> In Py3K from import * will be illegal, so this will unfortunately blow
> up the minute the "import_star_bad" is imported.

[Darrell]
> Has it been decided that "from x import *" will become illegal?

No.

> While dangerous, it can be useful.

Guido agrees.  There are likely to be more restrictions imposed on its use
over time, though.  For example, the Language Reference Manual has always
said "import *" is not to be used except at module scope (but that the
current implementation didn't enforce that).  2.2 *will* enforce that, but
only in some cases when it's combined with nested functions containing free
variables (see PEP 227 (Statically Nested Scopes) for details), and 2.1 will
start *warning* about such uses.





More information about the Python-list mailing list