[Python-Dev] 'import as'

Greg Ewing greg@cosc.canterbury.ac.nz
Fri, 18 Aug 2000 15:34:57 +1200 (NZST)


Gordon McMillan <gmcm@hypernet.com>:

> isn't the effect of "import goom.bah as snarf" the same as "from goom
> import bah as snarf"?

Only if goom.bah is a submodule or subpackage, I think.
Otherwise "import goom.bah" doesn't work in the first place.

I'm not sure that "import goom.bah as snarf" should
be allowed, even if goom.bah is a module. Should the
resulting object be referred to as snarf, snarf.bah
or goom.snarf?

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+