18.12.2011 00:49, Soeren Sonnenburg kirjoitti:
[clip]
> I've looked at the source code of numpy 1.6.1 and couldn't find the
> respective code... I guess I must be doing something wrong but there
> really was no call to PyObject_CheckBuffer() ...
Look for PyObject_GetBuffer
> The problem is I don'
On Sat, 2011-12-17 at 15:29 +0100, Pauli Virtanen wrote:
> 17.12.2011 09:42, Soeren Sonnenburg kirjoitti:
> > Doesn't work, complaining that the object has no __buffer__ attribute.
> >
> > Digging into the numpy c code it seems numpy doesn't even support the
> > buffer protocol but only the depreca
17.12.2011 09:42, Soeren Sonnenburg kirjoitti:
> Doesn't work, complaining that the object has no __buffer__ attribute.
>
> Digging into the numpy c code it seems numpy doesn't even support the
> buffer protocol but only the deprecated (old) one
> http://docs.python.org/c-api/objbuffer.html .
[clip
What version of numpy are you using? IIRC the new buffer protocol has
been supported since numpy 1.5.
On 17 December 2011 08:42, Soeren Sonnenburg wrote:
> Doesn't work, complaining that the object has no __buffer__ attribute.
>
> Digging into the numpy c code it seems numpy doesn't even support
Doesn't work, complaining that the object has no __buffer__ attribute.
Digging into the numpy c code it seems numpy doesn't even support the
buffer protocol but only the deprecated (old) one
http://docs.python.org/c-api/objbuffer.html .
At least there is nowhere a PyObject_CheckBuffer() call but
What happens if you use
y=numpy.frombuffer(x) ?
//Torgil
On Sat, Dec 17, 2011 at 1:41 AM, Soeren Sonnenburg wrote:
> Hi,
>
> I've implemented the buffer protocol
> (http://www.python.org/dev/peps/pep-3118/) for some matrix class and
> when I manually call PyObject_GetBuffer on that object I se
Hi,
I've implemented the buffer protocol
(http://www.python.org/dev/peps/pep-3118/) for some matrix class and
when I manually call PyObject_GetBuffer on that object I see that I get
the right matrix.
Now I'd like to see numpy use the buffer protocol of my class. Does
anyone know how to test that?