Lament: Import is not very smart.

Lonnie Princehouse finite.automaton at
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> wrote in message news:<10fa9pdto6pstf4 at>...
> "Greg Ewing" <greg at> wrote in message
> news:2ljm4dFch6u1U1 at
> > 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