
On Friday, July 29, 2011 05:48:32 AM Johan RĂ¥de wrote:
When I run the following code
C++:
#include
#include using boost::noncopyable; using namespace boost::python;
class X : noncopyable {};
PyObject* f() { return api::object(new X).ptr(); }
BOOST_PYTHON_MODULE(Foo) { class_
("X"); def("f", &f); } Python:
import Foo Foo.f()
then an exception, with the following error string, is thrown from the api::object constructor:
TypeError: No to_python (by-value) converter found for C++ type: class X
Am I using api::object incorrectly, or should I not use api::object at all but do something completely different?
As far as I can tell, the above should work. Could you please file a ticket on trac? Ravi