Message51938
METH_O is easy. Change METH_VARARGS to METH_O and the only difference is that in your function:
static void
my_meth_func(PyObject* self, PyObject* arg)
arg is now the single argument. So you don't need to call PyArg_ParseTuple. The code that originally looked like:
static void
my_meth_func(PyObject* self, PyObject* args) {
PyArg_ParseTuple(args, "O", &my_arg);
// use my_arg
becomes:
static void
my_meth_func(PyObject* self, PyObject* my_arg) {
// use my_arg
Hope that makes sense.
As for the length of visible vs non-visible attributes, can't you use the macros as the top of structseq.c file?
VISIBLE_SIZE, REAL_SIZE, UNNAMED_FIELDS and the _TP variants? |
|
Date |
User |
Action |
Args |
2007-08-23 15:56:42 | admin | link | issue1667546 messages |
2007-08-23 15:56:42 | admin | create | |
|