So far I have been using the C++ Python API directly for writing extension modules for Panda3D. Last week I have been dabbling around with Panda3D’s interrogate tool, and some questions popped up:
(1) Can interrogate create Python attributes for published members of C++ classes? For example, if you have a C++ class “Foo” with a member “int i;” and then use “interogate.exe” to create a Python wrapper. Is there a way to have a Python class “Foo”, with an attribute “Foo.i”?
I had a look at the interrogate source code, but I didn’t find anything. But I don’t know if I have been looking at the right places.
(2) Is there a way to pass dictionaries as method arguments for methods wrapped with interrogate? What would be the corresponding C++ datatype? std::map< PyObject*, PyObject* > perhaps.
(3) To create Python classes which support the number or sequence protocol, is it enough to define the proper C++ operators, and interrogate will do the rest? For example:
INLINE Foo operator + (const Foo &other) const;