Question about PyList

A

Adonis

Is there a C API equivalent to list.extend() and list.pop()? I have looked
through the documentation and googled, but nothing pinning the donkey.

Any help is greatly appreciated.

Adonis
 
J

Jeff Epler

There's always PyObject_CallMethod. I believe the code would look
something like
PyObject *o = ...;
PyObject *l = ...;
PyObject *r = PyObject_CallMethodObjArgs(l, "extend", o, NULL);
or
PyObject *l = ...;
PyObject *o = PyObject_CallMethod(l, "pop", NULL);

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBgmA0Jd01MZaTXX0RAvgBAJ43XJup8zIBDslTkIVjCBLdkbvTSQCeMALf
kkvuoWXBeR1HPPCEzY260Q8=
=1Kwe
-----END PGP SIGNATURE-----
 
V

vincent wehren

Adonis said:
Is there a C API equivalent to list.extend() and list.pop()? I have looked
through the documentation and googled, but nothing pinning the donkey.

Any help is greatly appreciated.

Adonis

As Alex Martelli pointed out some messages back , you can use the
PyObject_CallMethod function.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,209
Messages
2,571,089
Members
47,689
Latest member
kilaocrhtbfnr

Latest Threads

Top