|
From: Samuele P. <pe...@in...> - 2000-11-09 11:32:04
|
Hi.
Basically I have finished the tentative (open for discussion) patch/rewr.
for loading precedence and merging the PyJava*Package classes.
(I have setup also some hooks in PackageManager impl. and PyJavaPackage
for the future load sets).
I have to test it and then it will appear here.
I have some questions on assumptions I have made:
(I) For use as a 1st arg to a two args File ctr, an empty string is always
explicitly expanded in jython codebase, sometimes with
if( dir.equals("") ) dir=".";
sometimes with
if( dir.equals("") ) dir=<the value of System.getProperty("user.dir")>;
The two methods should be aquivalent, does someone know how could they
be different? which one should be preferred?
(e.g. are there problems with the first method on a Mac jvm?)
(II) a) I have fixed (I hope) the relative import in package modules bug
(runtime side, not jythonc yet),
I had to rewrite the three args imp.importName was code dealt only with
relative module import and not packages and was buggy wrt. to the top flag,
the runtime enforce and the old code assumed that if x.y.z is a key in
sys.modules (x.y.z loaded) also any subseq (e.g. x,x.y) will be present as a key
in sys.modules.
I have used that assumption too, and took care that the runtime enforce its
validity. Any one sees problem with that?
b) Is the following correct for CPython?, I have tryed to enforce it also
in jython:
p0,p1 are py packages
if I do the following in a p1.a module:
import sys
import p0.a.b.x
from p0.a.b.y import val
the keys p1.sys and p1.p0 will be added to sys.modules with value None.
But no key of the form p1.p0.a... etc. (clearly the plain keys p0... and sys,
binding to the real modules will be added too).
regards, Samuele
|