From: Rich S. <rse...@ya...> - 2001-05-31 21:53:36
|
Hi, We're seeing some behavior with the copy module in Jython. In the following test program, __del__ is only called for for the original objects, never for the copied ones. Is this normal? The same program (without java calls, of course) for CPython shows __del__ being called for both the original and copied objects. Regards, Rich Seddon from java.lang import System import copy class Foo: def __del__(self): print "In __del__ for", self if __name__ == '__main__': for i in range(0, 5): f= Foo() print 'Foo object:', f f2 = copy.copy(f) print 'Copied Foo object:', f2 f = None f2 = None print 'Running garbage collector' System.gc() __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |