Accessing a PyInstances dictionary from C++
simonb at webone.com.au
Fri Jan 3 09:21:04 CET 2003
On Fri, 03 Jan 2003 20:27:05 +1300, Lloyd wrote:
> I'm trying to call a method on a python object from C++. I have a PyInstance
> but can't for figure out how to obtain the dictionary from the instance so
> that I can call the method on the object.
> Any help appreciated.
PyObject_CallMethod(instance, method_name, format, ... )
there are a few other functions to check out,
and the dictionary could be obtained using PyObject_GetAttr,
Remember: all these Py* pointer things are also PyObject pointers.
eg. a PyInstanceObject is also (can be used as) a PyObject.
More information about the Python-list