python - PyArg_Parse returning frame object instead of PyLongObject -



python - PyArg_Parse returning frame object instead of PyLongObject -

i'm writing python module using c extension api , trying pass long variable python c function , raw pylongobject used represent variable.

i'm using pyarg_parse function parse variable raw c pointer. i'm expecting pyobject returned of type pylongobject, whenever inspect value of typename parsed object of type 'frame'? missing?

static pyobject* test(pyobject *self, pyobject *args) { pyobject *num; if(!pyarg_parse(args, "0", &num)) { //error yo } printf("\n%s\n", num->ob_type->tp_name); py_return_none; }

it looks if passing invalid argument format specification (never saw 0 (zero) there). result, exception don't deal with, treat return-value in "num" if successful value. on top of that, using deprecated function parse arguments.

python c python-extensions

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -