[C++-sig] numpy.ndarray did not match PyArrayObject *

Qinfeng(Javen) Shi shiqinfeng at gmail.com
Tue Sep 26 04:15:12 CEST 2006


Hi David,

Since bjam can't find PyArrayObject_Type, I also tried
boost::python::lvalue_from_pytype< extract_array_object,const &PyArrayObject
>(); //converter. line:23.

~~~~~~~~~~
instead of PyArrayObject_Type.
bjam reports that "hello.cpp:23: error: parse error before `>'
token".hello.cpp:23 is the line of converter.

Any suggestion?


// Boost Includes
==============================================================
#include <boost/python.hpp>
#include <boost/cstdint.hpp>

// Includes
====================================================================
#include "hello.c"

// Using
=======================================================================
using namespace boost::python;

// Declarations
================================================================
BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(PyObject)


// Module
======================================================================
BOOST_PYTHON_MODULE(hello)
{
    def("main", &main);
    def("testList", &testList, return_value_policy< return_opaque_pointer
>());
    def("testArray", &testArray);
    def("trace", &trace, return_value_policy< return_opaque_pointer >());
    boost::python::lvalue_from_pytype<extract_array_object,const
&PyArrayObject>();
}
--
Qinfeng(Javen) Shi

Research School of Information Sciences and Engineering
Australian National University
Locked Bag 8001
Canberra ACT 2601


-- 
Qinfeng(Javen) Shi

Research School of Information Sciences and Engineering
Australian National University
Locked Bag 8001
Canberra ACT 2601
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20060926/9f9a7fe1/attachment.htm>


More information about the Cplusplus-sig mailing list