[Python-Dev] New relative import issue

Steve Holden steve at holdenweb.com
Wed Sep 20 03:04:26 CEST 2006

Greg Ewing wrote:
> Steve Holden wrote:
>>This does, of course, assume that you're importing modules from the 
>>filestore, which assumption is no longer valid in the presence of PEP 
>>302 importers.
> Well, you need to allow for a sufficiently abstract
> notion of "filesystem".
For some value of "sufficiently" ...

> I haven't really thought it through in detail. It
> just seems as though it would be a lot less confusing
> if you could figure out from static information which
> module will get imported by a given import statement,
> instead of having it depend on the history of run-time
> modifications to sys.path. One such kind of static
> information is the layout of the filesystem.
Less confusing, but sadly also less realistic.

I suspect what's really needed is *more* importer behavior rather than 
less but, like you, I haven't yet thought it through in detail.

All I *can* tell you is once you start importing modules for a database 
the whole import mechanism starts to look a bit under-specified an 

Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden

More information about the Python-Dev mailing list