[Python-Dev] Is outlawing-nested-import-* only an implementation issue?

Guido van Rossum guido@digicool.com
Thu, 22 Feb 2001 22:36:08 -0500


>     1.  "exec('x = 1')" should behave exactly the same as "x = 1"

Sorry, no go.  This just isn't a useful feature.

>     2.  "from foo import *" should do the same as "x = 1"

But it is limiting because it hides information from the compiler, and
hence it is outlawed when it gets in the way of the compiler.

>     3.  "def g(): print x" should behave the same as "print x"

Huh? again.  Defining a function does't call it.  Python has always
adhered to the principle that the context where a function is defined
determines its context, not where it is called.

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