Jython and super_reload?
ykingma at accessforall.nl
Thu Aug 19 09:37:08 CEST 2004
Dave Benjamin wrote:
> There have been several discussions here about how to write a reload()
> function that works for classes as well as modules:
> I have been trying to come up with a solution that works for Jython, and
> far nothing has worked. I was wondering if anyone has attempted or
> in writing such a function for Jython.
This works for classes:
You can unload a module in Jython by removing it from sys.modules,
and (off course) by removing all other references to it.
To be sure about what happens you can tell the JVM to be verbose
about garbage collection of Java classes, and explicitly call
java.lang.System.gc() in some test scripts.
More information about the Python-list