Message43006
Logged In: YES
user_id=89016
A use case can be found at
http://www.livinglogic.de/viewcvs/index.cgi/LivingLogic/xist/_xist/xsc.py?rev=2.235
(Look for the classmethod makemod() in the class Namespace).
This puts a class object into sys.modules instead of the
module that defines this class. This makes it possible to
derive from "modules".
Of course the patch does not fully fix the problem, because
reload() does not repopulate the class object. Unfortunately
that's impossible to fix with Python code, as it's
impossible for Python code to distinguish the first import
from subsequent ones. If this was possible (and Python code
had access to the old "module"), a real reload could be
coded in pure Python for this specific case.
But with the patch at least it's possible to use the return
value of reload() afterwards to use the new "module". |
|
| Date |
User |
Action |
Args |
| 2007-08-23 15:21:08 | admin | link | issue701743 messages |
| 2007-08-23 15:21:08 | admin | create | |
|