Wrapping C++ Class Heirachy in Python

Andrew Wilkinson ajw140NO at SPAMyork.ac.uk
Mon Apr 18 17:40:27 EDT 2005


Hi,

I'm trying to wrap a C++ class hierarchy with Python types and I'd like to
maintain the hierarchy in the types. I'm fairly sure this is possible,
isn't it?

Are there any documents explaining how to do this, the standard Python
manual doesn't go into enough detail about creating types for this.

I've found the tp_base and tp_bases elements and I've set them to the base
type object (and a tuple containing the base type object) before I call
PyType_Ready but in Python the base class isn't recognised. Is there
anything obvious I'm missing?

Thanks in advance for any help,
Andrew Wilkinson




More information about the Python-list mailing list