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't really know what is supposed to happen if the new
> buffer protocol is supported by some class named say Foo. Could I then
> do
>
> x=Foo([1,2,3])
>
> numpy.array([2,2,2])+x
>
> and such operations?

Yes. You can try it out with Python's builtin memoryview class.

-- 
Pauli Virtanen

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to