[Python-Dev] ast-objects branch created

Fredrik Lundh fredrik at pythonware.com
Wed Dec 7 23:20:34 CET 2005


"Delaney, Timothy (Tim)" wrote:

> > Nick Coghlan wrote:
> >> As Fredrik pointed out a while back, the PyObject approach doesn't
> >> *have* to involve manual decref operations - PyObject's come with a
> >> ready made arena structure, in the form of PyList.
> >
> > That doesn't really work: PyList_Append (which you would have to use)
> > duplicates the reference, so you would still have to decref it
> > explicitly.
>
> Hmm - perhaps we should have a set of Arena functions/macros e.g. PyArena_Add - works like
> PyList_Append, but doesn't duplicate the reference (or immediately decrefs it).
>
> I'm sure there are other parts of the code base that would benefit from this.

if you check my original post, you'll find code for a new list helper function,
which would solve this in a convenient way.

</F>





More information about the Python-Dev mailing list