[Python-Dev] Package ambiguities

M.-A. Lemburg mal@lemburg.com
Thu, 08 Jun 2000 16:54:01 +0200


Jeremy Hylton wrote:
> 
> Gordon's comments are on the money.  An import in a module inside a
> package should be fully qualified.  I'd put that in the style guide if
> it were up to me (and, of course, it's not).

+1 from here :-)

I usually write things like this:

from mx.DateTime import now
print 'The time is', now()

If you don't do so, you'll run into strange problems, the most
subtle one I've encountered is with pickled objects... if unpickled
inside the same package they can cause the same module to
be loaded *twice* with all the consequences attached to this 
(e.g. issubclass() no longer works).

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/