__del__ problem (destructor called After members of a class are deleted?)

Robert Roy rjroy at takingcontrol.com
Tue Apr 18 15:52:18 EDT 2000


Sometimes Oversimplified is wayyyy too oversimplified. 
What is bar? At least post a fragment that demonstrates the exception.
What you have posted is meaningless in context with your question. In
fact with the addition of a trivial bar class (class bar: pass) and a
pass statement in the close method, the code you have posted is
correct.

Throw us a bone to chew on :-)

Bob

On Tue, 18 Apr 2000 15:13:08 -0400, "Warren Postma"
<embed at geocities.com> wrote:

>What's going on here?
>
>Exception except.AttributeError: "'None' object has no attribute 'time'" in
><met
>hod lwdb_base.__del__ of lwdb_hash instance at 5de410> ignored
>Exception except.AttributeError: "'None' object has no attribute
>'delete_DB'" in
> <method DBPtr.__del__ of DB instance at 5dfd00> ignored
>Exception except.AttributeError: "'None' object has no attribute 'time'" in
><met
>hod lwdb_base.__del__ of lwdb_base instance at 5de6d0> ignored
>
>
>Why is __del__ being called with a self = None ?
>
>
>
>Oversimplified Code Snippet:
>
>class foo(bar):
>    def close(self):
>        # pretend I do stuff here
>
>    def __del__(self):
>        #print "lwdbtable.__del__"
>        self.close()
>
>
>Warren
>
>




More information about the Python-list mailing list