Synopsis: Would I be correct in inferring that the Jython path mechanism
only works if the different nodes along the path contain completely
non-overlapping package structures? Is there any way around this?
I had been planning on encouraging the use of "python.path" in our
Jython development environment. Developers would work in a local image
of the Jython directory hierarchy, but would also reference a standard
version of the same directory hierarchy. (In a C/C++ environment, you
might refer to this as developing using a "view path", with transparent
overlapping "layers" of directories and files.) It turns out that this
usage apparently doesn't work in Jython, at least not in an environment
where we want to use a non-trivial package structure to organize our
Let me provide some examples. For all examples, suppose python.path has
been set such that sys.path == ['/A', '/B'].
Suppose that /A contains a directory /A/X with files __init__.py and
xena.py, while /B contains a directory /B/Y with files __init__.py and
yankee.py. Then, as expected, one can "import X.xena" and "import
Y.yankee". So far so good.
But, if instead /A contains directory /A/R with file __init__.py and
directory /A/R/X with files __init__.py and xena.py, while /B contains
directory /B/R with file __init__.py and directory /B/R/Y containing
__init__.py and yankee.py. Then "import R.X.xena" succeeds, but "import
R.Y.yankee" fails. Interestingly, both "import R.X" and "import R.Y"
I've tried tinkering with not including the (empty) __init__.py file in
some directories, but this hasn't improved the situation.
So, it appears that the Jython path mechanism only works if the
different nodes along the path contain completely non-overlapping
Am I missing anything?