Lament: Import is not very smart.

Lonnie Princehouse finite.automaton at gmail.com
Wed Jul 14 23:00:50 CEST 2004


Aha!  Someone else has been boggled by this too.  It's an easy problem
to avoid in simple code, but much more difficult once one starts doing
esoteric things with __import__ and sys.path...


"John Roth" <newsgroups at jhrothjr.com> wrote in message news:<10fa9pdto6pstf4 at news.supernews.com>...
> "Greg Ewing" <greg at cosc.canterbury.ac.nz> wrote in message
> news:2ljm4dFch6u1U1 at uni-berlin.de...
> > Lonnie Princehouse wrote:
> > > Suppose that you've a package named "foo" which contains module "bar".
> > >  Because you're careless, you've also put foo/ into your path...
> >
> > The solution to that is not to be careless (i.e. don't
> > put overlapping entries into your path).
> 
> Sometimes it isn't carelessness. You wouldn't believe the
> amount of trouble that caused me with the FIT port.
> 
> John Roth



More information about the Python-list mailing list