Name of current method (for C functions) ?
tgloth at earthlink.net
Wed Oct 24 02:08:18 CEST 2001
I am implementing a module for python that registers new methods
dynamically, using Py_InitModule. At compile-time it is not known
how many methods will be registered, so I can't provide a separate
callback for each method. My plan is to register the same C function
for all those python methods, and from within that C function
dispatch, based on the name the function was called under.
The problem is: I seem to be unable to obtain the name of the
current method anywhere. For methods implemented in python this
works, by analyzing the call stack, but for C functions, the relevant
name field is empty.
Any hints or suggestions would be greatly appreciated!
More information about the Python-list