__subclasses__() (was OK, now *this* is cool)

Andrew Dalke dalke at dalkescientific.com
Sun Dec 9 17:41:55 EST 2001


Ype Kingma:
> Jython leaves all it's garbage collection to the Java VM.
> This simplifies the Jython source code (a lot, no reference
> counting anywhere). On the downside it is more difficult
> to have a method executed when an object becomes garbage.

"more difficut" means it's still possible.  How?

I have a Python wrapper on top of a C library.  I use
__del__ to call the special deallocator for the library
when the object is no longer needed.

The library also has bindings for use with Java.  I tried
using JPython (it was a while ago) but got memory leaks
all over the place because it doesn't call __del__ methods;
prefering the Java garbage collector.

How do I make Jython work with that wrapper?  try/finally
doesn't work for my needs.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list