Wrapping C++ Class Heirachy in Python

Andrew Wilkinson ajw140NO at SPAMyork.ac.uk
Tue Apr 19 07:47:23 EDT 2005


Steve Juranich wrote:
>> 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?
> 
> Well, I can't really recommend without seeing what you did (did you
> remember the preceding "&" for the type struct?

I realised it will be a little difficult to help without seeing my source,
but I was hoping someone would point me to some documentation so I wouldn't
have to cut my source down to an example suitable for a usenet post.
 
> Otherwise, I'd have to recommend Objects/unicodeobject.c in the Python
> source as a reference for how to do this.

Thanks! I was trying to think of a built in object hierarchy in Python, I
didn't think of unicode strings.

Cheers!

Andrew

Simple distributed computing with Python...
PyLinda - http://www-users.cs.york.ac.uk/~aw/pylinda



More information about the Python-list mailing list