T
Thomas Heller
I once knew how to do it, but I cannot find or remember it anymore:
How can I attach *class* methods to a type in C code, when I have a
function
PyObject *func(PyObject *type, PyObject *arg);
with the METH_O calling convention? The type is already created, I
cannot insert it into the tp_methods array anymore.
Something like this:
class X(object):
pass
def func(cls, arg):
....
X.func = classmethod(func)
Thanks,
Thomas
How can I attach *class* methods to a type in C code, when I have a
function
PyObject *func(PyObject *type, PyObject *arg);
with the METH_O calling convention? The type is already created, I
cannot insert it into the tp_methods array anymore.
Something like this:
class X(object):
pass
def func(cls, arg):
....
X.func = classmethod(func)
Thanks,
Thomas