[Zope3-dev] directory hierarchy proposal
Phillip J. Eby
pje@telecommunity.com
Mon, 16 Dec 2002 10:20:02 -0500
At 03:28 PM 12/16/02 +0100, holger krekel wrote:
>My main concern is basically that in a more complex (e.g. developer's setup)
>you have two modules with the same name in your pythonpath.
Actually, no, you won't. sys.path only contains directories, not modules
or packages.
>thanks for the explanation. IMO without further checks (e.g. warnings for
>duplicate names in different locations) this can be very confusing
>especially if you are remotely analyzing a customer problem who might
>have installed lots of stuff and has a path with many items.
How is that different from PYTHONPATH now? If it has more than one
directory that contains a module, the first one is loaded. The only
difference now is that if a module or subpackage contained in a namespace
package *isn't* found, the search continues along the path.
There isn't any way to actually have two of anything. Only *one*
__init__.py (the first) for a namespace package will be loaded. Only the
first version found of any immediately contained item will be loaded.