C Extension question-> How handle lists and tuples as arguments?

Christian Seberino seberino at spawar.navy.mil
Wed Oct 8 15:18:52 EDT 2003


Py_ParseTuple is a great C function to set C variables from
Python objects in a C extension.

Usage is straight forward for integers and strings but I'm wondering
what to do if I ever want to send in a list or tuple.

First problem is that we don't know the LENGTH of the list/tuple.

Second problem is we don't know the TYPES of the elements.

Chris




More information about the Python-list mailing list