[C++-sig] C++ object pointers contained in a vector

Noah Schwartz noah.schwartz1 at gmail.com
Wed Oct 18 22:04:07 CEST 2006


Hi,

I've used the vector_indexing_suite to expose vectors containing pointers to 
some class. I see that I can't iterate over this vector in Python like I can 
with say, a vector of floats. I get the following error:
TypeError: No to_python (by-value) converter found for C++ type: MyClass*

MyClass is already exposed properly. I can even use a MyClass* fine in Python 
when other C++ functions return a pointer to one.

I am guessing that I need to define a to_python converter either in MyClass or 
in a new class, MyClass*. Not really sure how that works though.

Noah



More information about the Cplusplus-sig mailing list