Python C extension help

08/27/2019 19:51 elmarcia#1
Hi, i'm learning python C extensions and want to implement my own dynamic stack function, i made it work but don't know how to return a non-tuple value.

Am i missing something or what, i used as reference python's collection module but i can't figure out what i'm doing wrong.
I don't want to put python code to manage the tuple return i need it to be embedded in c code. (also should return any data type)

My module:
[Only registered and activated users can see links. Click Here To Register...]

Python collection module (deque):
[Only registered and activated users can see links. Click Here To Register...]

My stack module

collections module: [Only registered and activated users can see links. Click Here To Register...]
09/02/2019 18:33 sk8land​#2
Change line
Code:
{"push",(PyCFunction)Stack_setContent,METH_VARARGS,"..."},
into
Code:
{"push",(PyCFunction)Stack_setContent,METH_O,"..."},
09/05/2019 23:41 elmarcia#3
Quote:
Originally Posted by sk8land​ View Post
Change line
Code:
{"push",(PyCFunction)Stack_setContent,METH_VARARGS,"..."},
into
Code:
{"push",(PyCFunction)Stack_setContent,METH_O,"..."},
LOL, i read all examples but can't find that, thx dude!