Problems sending list/tuple to a C extension.

Christian Seberino seberino at spawar.navy.mil
Thu Nov 20 20:46:43 EST 2003


I successfuly created some toy C extensions that compiled and
ran without bugs with arguments that consisted of strings and numbers.

python.org docs seem to suggest that sending in lists and tuples
was as simple as changing string in PyArg_ParseTuple to contain
parens or brackets....

e.g.

   "ii" ==> "(ii)" or "[ii]"

I tried this many times and always never got PyArg_ParseTuple to
successfully work with new version.


>>> import mymodule2
>>> mymodule2.test([3,4])
a=1108554272, b=1107769229

a should be 3 and b should be 4!!!

Chris




More information about the Python-list mailing list