Module/package hierarchy and its separation from file structure

Ben Finney bignose+hates-spam at benfinney.id.au
Wed Jan 30 20:31:29 EST 2008


Peter Schuller <peter.schuller at infidyne.com> writes:

> I *DON'T* want anything to depend on the physical location on disk.

Importing the code in the first place will — unavoidably, it seems to
me — depend on the file location from which to load the module.

After that, nothing depends on the physical location on disk, unless
it's buggy. Imported modules are available from 'sys.modules', and
that's where subsequent 'import' statements will find them, with no
reference to file locations.

> That was exactly what I was after from the beginning; a total
> separation of location on disk from the location in the module
> hiearachy. As you say, the location of the source should be an
> implementation detail. That is exactly what I am after.

It *is* an implementation detail, once the module is loaded from disk.

-- 
 \       "Philosophy is questions that may never be answered. Religion |
  `\              is answers that may never be questioned." —anonymous |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list