Name of current method (for C functions) ?

Martin von Loewis loewis at informatik.hu-berlin.de
Wed Oct 24 06:00:15 EDT 2001


tgloth at earthlink.net (Tobias Gloth) writes:

> Any hints or suggestions would be greatly appreciated!

Before being called, each C function is wrapped with a
PyCFunctionObject. You normally don't create those yourself (but use
Py_FindMethod instead), but in this case, you should: Each C function
has an m_self member, which is passed as the first argument to the
function. When creating a C function (via PyCFunction_New), you can
put any PyObject* into self, for example the string representing the
function name.

HTH,
Martin




More information about the Python-list mailing list