|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /proc/self/root/usr/lib/python2.4/site-packages/mx/Proxy/mxProxy/ |
Upload File : |
import sys
import mx.Proxy
class Object:
def __init__(self, id):
self.id = id
def __del__(self):
print self.id, 'deleted'
def __repr__(self):
return '<Object %s at %d (0x%x)>' % (self.id, id(self), id(self))
def test():
x = Object('first')
x.y = Object('second')
x.y.x = mx.Proxy.WeakProxy(x)
test()
# if I uncomment the following, everything works as expected, which suggests
# to me that either the WeakReferences dictionary is not getting GC'd
#y = x.y
#del x
#print y.x.id