class C(): def __init__(self): print 'initialized' def __del__(self): print 'deleted'c1 = C() c2 = c1 c3 = c1 print id(c1), id(c2), id(c3) del c1 del c2 del c3 class InstCt(object): count = 0 def __init__(self): InstCt.count += 1 def __del__(self): InstCt.count -= 1 def howMany(self): return InstCt.counta = InstCt()b = InstCt()print b.howMany()print a.howMany()del bprint a.howMany()del aInstCt.count
Name (required)
email (will not be published) (required)
Website