[C++-sig] "TypeError: No to_python (by-value) converter found for C++ type: Node"

Stefan Seefeld seefeld at sympatico.ca
Thu Feb 3 00:15:05 CET 2005


hi there,

I'v stripped down code to reproduce an issue I reported earlier. Please
find attached an extension module as well as a little driver script
that do the following:

Exposed are a 'Node' and a 'Visitor' type. The 'Visitor' is wrapped
to be subclassed in python.
In python, I call

node.accept(visitor)

and expect my node (in C++) to invoke 'VisitorWrapper::visit(this)',
which by means of 'call_method' delegates the call to the python
subclass. The error suggests that the bpl runtime isn't able to
find a python type for 'this'.
Creating a Node via 'create' from within python worked fine, though.

Does anybody have an idea what is going on here ?

Thanks,
		Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.cc
Type: text/x-c++src
Size: 840 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20050202/dba9714a/attachment.cc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: application/x-python
Size: 133 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20050202/dba9714a/attachment.bin>


More information about the Cplusplus-sig mailing list