destroy your self????

Ron Adam rrr at ronadam.com
Wed Oct 19 23:04:48 EDT 2005


KraftDiner wrote:
> if I create an object like...
> 
> obj = None
> ...
> obj = anObject()
> 
> can obj set itself to none in some method of the class?
> 


Do you mean like this?


 >>> def foo():
...   global foo
...   del foo
...
 >>> foo()
 >>> foo
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
NameError: name 'foo' is not defined


Cheers,
    Ron



More information about the Python-list mailing list