[Python-Dev] Re: are CObjects inherently unsafe?

Fredrik Lundh fredrik at pythonware.com
Mon Dec 8 05:54:31 EST 2003


Michael Hudson wrote:

> > A string isn't the only thing that could usefully be used
> > as a descriptor.
>
> What else would you consider useful?  I'm only really aware of the
> most straightforward uses of CObjects (and wonder if the advanced uses
> actually see much use...).

the descriptor is passed to the destructor, so it can be used to hold data
associated with the object.

checking our repository, I cannot find a single example where I haven't
used the descriptor at all; the most common use is to point to a "MAGIC"
string, and there's one case where I've used it to keep a reference to a
PyObject that's related to the CObject pointer.

</F>






More information about the Python-Dev mailing list