Message1098

Author pedronis
Recipients
Date 2006-04-16.13:46:06
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=61408

the PEP302 implementation promoted java importing to a
meta_path importer. This was the right move forward but
these are tried before normal imports.

The total result is that now java imports take precedence
over Python imports. This is too much of a backward
incompatible change, also I fear it may breaks subtle
assumptions that are still in place when one mixes java
classes on the sys.path.

One possible solution is to promote normal sys.path python
importing as a meta_path elements too, and put it before the
java importer. This is the long term plan for CPython too,
but because is not implemented there (and may not be for a
while) it may create subtle incompatibilities too, depending
on how people use the meta_path.

The other solution (which was discussed around the PEP302
impl time) is to have a different entry in the importer
interface to load java classes and do a first pass over
meta_path and normal imports to load python modules and a
second one (using the different entry point) to load java
classes. Java importing is not supported anyway by CPython.
This would also re-establish the correct and backward
compatible precedences.

I fear I will not have time for a while to dig more into
this myself, although importing is an area I know very well.
It's also a pity that we didn't manage to simplify our
import mechanism or really improve on it.
History
Date User Action Args
2008-02-20 17:17:27adminlinkissue1421812 messages
2008-02-20 17:17:27admincreate