[Python-Dev] Let's update CObject API so it is safe and regular!
Antoine Pitrou
solipsis at pitrou.net
Thu Apr 2 19:24:04 CEST 2009
Guido van Rossum <guido <at> python.org> writes:
>
> On Thu, Apr 2, 2009 at 6:22 AM, Jim Fulton <jim <at> zope.com> wrote:
> > The original use case for CObjects was to export an API from a module, in
> > which case, you'd be importing the API from the module.
>
> I consider this the *only* use case. What other use cases are there?
I don't know if it is good style, but I could imagine it being used to
accumulate non-PyObject data in a Python container (e.g. a list), without too
much overhead.
It is used in getargs.c to manage a list of "destructors" of temporarily created
data for when a call to PyArg_Parse* fails.
More information about the Python-Dev
mailing list