Python C API Question.

Diez B. Roggisch deetsNOSPAM at web.de
Sat Oct 23 07:36:54 EDT 2004


Adonis wrote:

> This is my first crack at using Python from a C level, and also a long
> time since I have even used C, so my wording might be off, when creating a
> new list utilizing the PyList_New(...) function, instead of creating a
> list of a fixed length, is there a way to create a variabled length
> instead?

AFAIK they are always variable length - they always support appending to
them. The argument is just about the initial capacity, so if you know that
beforehand, you can optimize allocation of list entries.
-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list