[C++-sig] (David Abrahams)numpy.ndarray did not match PyArrayObject *

David Abrahams dave at boost-consulting.com
Wed Sep 27 16:58:50 CEST 2006


"Qinfeng(Javen) Shi " <shiqinfeng at gmail.com> writes:

> Hi David,
>
>
>>boost::python::lvalue_from_pytype<extract_array_object,&PyArrayObject_Type>();
>>struct extract_array_object
>> {
>>     static PyArrayObject& execute(PyArrayObject& x)
>>     {
>>         return x;
>>     }
>> };
>> Yes, the very subtle trick at the bottom of my posting
>> "replace the indicated with the name of NumPy's python type object
>> for ndarray."
>
> Sorry, I don't get you.
> The Python type of the ndarray is PyArray_Type. 

Good.  In my original example, replace PyArrayObject_Type with
PyArray_Type.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list