Re: handle for list constructor?

Guido.van.Rossum@cwi.nl
Fri, 04 Mar 1994 23:54:29 +0100

> > For manipulating Python lists from C, there's a whole load of
> > functions (defined in Include/listobject.h) which you can used.
>
> How safe is it to use these functions in terms of code maintenance?
> Is there any chance that these interfaces might change in future releases?

Fairly safe -- they are used in way too many places to make it easy
for me to change their interfaces now in an incompatible manner.

> Is it sufficient to check for a None return value or is it necessary to
> call err_occurred() or err_get()?

You certainly mean a NULL return! Also, some functions return -1 for
errors (read the docs -- i.e. the source :-). And no, it is never
necessary to call err_occurred() or err_get(). There is a little bit
on this in the extensions manual.

> Thanks for the quick response to the list question!

You're welcome!

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>