Does python hate cathy?

Carsten Haese carsten at uniqsys.com
Sun Mar 23 21:18:31 EDT 2008


On Sun, 2008-03-23 at 20:05 -0500, Michael Wieher wrote:
>         is that farnarkeling about in a __del__ method is *not* a good
>         idea.
> 
> Ok that having been said, is accessing an unbound variable of a class
> and using it to coordinate between instances of that class common
> practice?

I'm not sure what you mean by "accessing an unbound variable" means in
the context of this thread, or any context for that matter. Nothing of
the kind is happening in the OP's example. What's happening is that a
class attribute is initialized, incremented, and decremented. Using
class attributes is common practice.

The problem, as I explained in my previous post, is that the class
attribute is looked up via a global name of the class, and that name may
or may not have disappeared in a puff of logic by the time the
instance's __del__ method is run in the VM shutdown sequence.

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list