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
Doesn't work for classes because self has no global reference.
--
http://mail.python.org/mailman/listinfo/python-list
"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
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 "",
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
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
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
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