[C++-sig] accessing nontrivial types

Anders Wallin anders.e.e.wallin at gmail.com
Thu Feb 4 19:22:58 CET 2010


Hello group,
simple types (int, float, etc.) seem to transfer without problem to
C++ and back to Python, but whenever I try returning something
nontrivial from C++ I get something like this:
>>> a = myclass.Myclass()
>>> print a.i
42
>>> print a.f
3.14159
>>> print a.ilist
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: No Python class registered for C++ class std::list<int,
std::allocator<int> >


The code for this example is here:
http://pastebin.com/m4c45a88

I tried looking in the documentation but was not able to understand
what to do about this error. Any examples out there?

thanks,
AW


More information about the Cplusplus-sig mailing list