Message119
A small difference between JPython 1.1b4 and CPython 1.5.2. In CPython a package
initialization can change its own slot in sys.modules. This allow
pkg\__init__.py to controll what will be returned by a "import pkg". In JPython
"import pkg" always return the PyModule containing the pkg.__init__.
PMW uses this trick to return a specifik version of of the PMW toolkit.
------------------ FILE: test173.py ------------------
import test173p
print test173p
------------------ END ------------------
------------------ FILE: test173p\__init__.py ------------------
import sys
sys.modules['test173p'] = sys
------------------ END ------------------
Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import test173
<module 'sys' (built-in)>
>>>
JPython 1.1beta4 on java1.3beta (JIT: null)
Copyright (C) 1997-1999 Corporation for National Research Initiatives
>>> import test173
<module test173p at 2864404>
>>>
|
|
Date |
User |
Action |
Args |
2008-02-20 17:16:41 | admin | link | issue222836 messages |
2008-02-20 17:16:41 | admin | create | |
|