Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Question about PyList

Reply
Thread Tools

Question about PyList

 
 
Adonis
Guest
Posts: n/a
 
      10-29-2004
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


 
Reply With Quote
 
 
 
 
Jeff Epler
Guest
Posts: n/a
 
      10-29-2004
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)

iD8DBQFBgmA0Jd01MZaTXX0RAvgBAJ43XJup8zIBDslTkIVjCB LdkbvTSQCeMALf
kkvuoWXBeR1HPPCEzY260Q8=
=1Kwe
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
 
vincent wehren
Guest
Posts: n/a
 
      10-29-2004
Adonis wrote:
> 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,
--
Vincent Wehren
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cpoying a PyList to a C string array Sheldon Python 3 12-19-2006 11:18 PM
Quick Question - Newby Question =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 4 02-16-2005 11:59 AM
Question on Transcender Question :-) eddiec MCSE 6 05-20-2004 06:59 AM
Question re: features of the 831 router (also a 924 question) Wayne Cisco 0 03-02-2004 07:57 PM
Syntax Question - Novice Question sean ASP .Net 1 10-20-2003 12:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57