LittleDemon WebShell


Linux server27.hostingraja.org 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64
Path : /usr/lib64/python2.6/site-packages/mx/Proxy/mxProxy/
File Upload :
Command :
Current File : //usr/lib64/python2.6/site-packages/mx/Proxy/mxProxy/weakreftest.py

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

LittleDemon - FACEBOOK
[ KELUAR ]