Re: destroy your self????

2005-10-20 Thread Ron Adam
James wrote: > Doesn't work for classes because self has no global reference. True. To make it work one would need to track instances and names and do comparisons... and so on. So it's not worth it. ;-) Cheers, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: destroy your self????

2005-10-20 Thread James
Doesn't work for classes because self has no global reference. -- http://mail.python.org/mailman/listinfo/python-list

Re: destroy your self????

2005-10-19 Thread Mike Meyer
"KraftDiner" <[EMAIL PROTECTED]> writes: > Well I guess what I'm trying to achive is the invalidate the instance > of the object. > I have been using None to denote an invalide or uninitialized instance > of an object. > > There is a degenerate case in my code where a polygon has less than 3 > poi

Re: destroy your self????

2005-10-19 Thread Ron Adam
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 "",

Re: destroy your self????

2005-10-19 Thread Dave Brueck
KraftDiner wrote: > Well I guess what I'm trying to achive is the invalidate the instance > of the object. > I have been using None to denote an invalide or uninitialized instance > of an object. > > There is a degenerate case in my code where a polygon has less than 3 > points and > I want to cla

Re: destroy your self????

2005-10-19 Thread KraftDiner
Well I guess what I'm trying to achive is the invalidate the instance of the object. I have been using None to denote an invalide or uninitialized instance of an object. There is a degenerate case in my code where a polygon has less than 3 points and I want to class to flag this instance of the ob

Re: destroy your self????

2005-10-19 Thread Dave Brueck
KraftDiner wrote: > if I create an object like... > > obj = None > ... > obj = anObject() > > can obj set itself to none in some method of the class? No - Python doesn't work that way. What are you trying to accomplish? There's probably a way to do what you need to do, but this isn't it. -Da

destroy your self????

2005-10-19 Thread KraftDiner
if I create an object like... obj = None ... obj = anObject() can obj set itself to none in some method of the class? -- http://mail.python.org/mailman/listinfo/python-list