Re: __del__ and reference count problem

2005-04-21 Thread Terry Reedy
"tiissa" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It's interesting to note that self.pop instead of A.pop works as > expected. > But I don't know why A.pop doesn't. Because the name 'A' is no longer associated with the class object. However, self has a reference to the cla

Re: __del__ and reference count problem

2005-04-21 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > it looks like we have to use other way, hold the data we want to > preseve in an object, because it is possible the class is removed > before the instance cleaned, What is removed first is the binding between name A and the class obje

Re: __del__ and reference count problem

2005-04-21 Thread flupke
[EMAIL PROTECTED] wrote: look at this discussion: http://www.dbforums.com/archive/index.php/t-1100372.html it looks like we have to use other way, hold the data we want to preseve in an object, because it is possible the class is removed before the instance cleaned, and we can not expect __del__ 10

Re: __del__ and reference count problem

2005-04-21 Thread [EMAIL PROTECTED]
look at this discussion: http://www.dbforums.com/archive/index.php/t-1100372.html it looks like we have to use other way, hold the data we want to preseve in an object, because it is possible the class is removed before the instance cleaned, and we can not expect __del__ 100% in handling finalizin

Re: __del__ and reference count problem

2005-04-21 Thread tiissa
[EMAIL PROTECTED] wrote: Your problem can be simplified : class A: pop = 11 def __del__(self): print A.pop if __name__ == '__main__': objA = A() I got the same error message, and I don't know why ? it looks like the class variable can't be accessed from __del__? It's interesting to note t

Re: __del__ and reference count problem

2005-04-21 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Your problem can be simplified : class A: pop = 11 def __del__(self): print A.pop if __name__ == '__main__': objA = A() Exception exceptions.AttributeError: "'NoneType' object has no attribute 'pop'" in > ignored I got the same error message, and I don't know why ? it

Re: __del__ and reference count problem

2005-04-21 Thread [EMAIL PROTECTED]
Your problem can be simplified : class A: pop = 11 def __del__(self): print A.pop if __name__ == '__main__': objA = A() Exception exceptions.AttributeError: "'NoneType' object has no attribute 'pop'" in > ignored I got the same error message, and I don't know why ? it looks like the c