Cross-reference 'import' in a class hierarchy

Michael Hudson mwh at python.net
Mon Apr 7 06:45:58 EDT 2003


Ben Finney <bignose-hates-spam at and-zip-does-too.com.au> writes:

> On Sun, 06 Apr 2003, Erik Max Francis wrote:
> >  Ben Finney wrote:
> > > In ork.py I want:
> > >     import eek
> >  
> > If the toplevel package is put in a place where Python can find it,
> >  	import monty.foo.eek
> 
> It's not.  Even if I make it so on my computer, it's not going to be so
> on someone else's computer when they download my package tree.

It is a Fact Of Life that Python packages (and modules therein) need
to know where they are in the global module namespace.

Cheers,
M.

-- 
  Programming languages should be designed not by piling feature on
  top of feature, but by removing the weaknesses and restrictions
  that make the additional features appear necessary.
               -- Revised(5) Report on the Algorithmic Language Scheme




More information about the Python-list mailing list