[Python-Dev] 'import as'

Fred L. Drake, Jr. fdrake@beopen.com
Fri, 18 Aug 2000 12:37:02 -0400 (EDT)


Thomas Wouters writes:
 > What are we voting on, here ?

  We should be really clear about this, since it is confusing.

 > import <name> as <localname> (in general)

  +1 for this basic usage.

 > import <name1>.<nameN>+ as <localname> (where localname turns out an alias
 > for name1)

  -1, because it's confusing for users

 > import <name1>.<nameN>*.<nameX> as <localname> (where localname turns out an
 > alias for nameX, that is, the last part of the dotted name that's being
 > imported)

  +1 on the idea, but the circular import issue is very real and I'm
not sure of the best way to solve it.
  For now, let's support:

	import name1 as localname

where neither name1 nor localname can be dotted.  The dotted-name1
case can be added when the circular import issue can be dealt with.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at beopen.com>
BeOpen PythonLabs Team Member