[Pythonmac-SIG] weird syntax error (bug?): self.from

Jack Jansen jack@oratrix.nl
Thu, 21 Sep 2000 12:14:31 +0200


> Hummm. What I have been wondering is that with Python designed to be
> easy to code/read... why doesn't it us the Java syntax "import foo.*". 
> This would be much more consistent with "import foo" than "from foo
> import *". I guess that it is this way to discurage people from using
> "from foo import *". In that case it is a subtler hint tword good
> programming style, than Java's simply outlawing pointers for example.

Note that "import foo.*" would have to mean something quite like "import foo", 
not like "from foo import *".

If you say "from foo import bar" Python takes bar from the foo namespace and 
inserts it into the current namespace, under name bar.

If you say "import foo.bar" bar is inserted into the foo namespace.

Things are pretty complicated due to packages and such, but this is the basic 
idea.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm