[C++-sig] problems with lvalue_from_pytype

Mark Russell mrussell8081 at pacbell.net
Sun Nov 17 00:15:23 CET 2002

I'm trying to reconstruct the example for lvalue_from_pytype and am having a
few problems. I implemented the example as follows as I could not find
reference.hpp--I just want an identity function anyway just to know that I
can read the type I am trying to convert. I built noddy from the python
docs.  The following builds just fine but when I try to use is_noddy a get
a --  TypeError: bad argument for built-in operation --  Where am I going

#include <boost/python.hpp>
using namespace boost::python;

PyTypeObject noddy_NoddyType;
typedef struct
} noddy_NoddyObject;

//identity function
bool is_noddy(noddy_NoddyObject* x)
	if (typeid(noddy_NoddyObject*) == typeid(x)) return true;
	return false;

	def("is_noddy", is_noddy);

More information about the Cplusplus-sig mailing list