[Numpy-discussion] Porting strategy for py3k
Dag Sverre Seljebotn
Mon May 4 07:22:34 CDT 2009
David Cournapeau wrote:
> On Mon, May 4, 2009 at 1:24 AM, Dag Sverre Seljebotn
> <firstname.lastname@example.org> wrote:
>> David Cournapeau wrote:
>>> On Fri, Apr 24, 2009 at 4:49 PM, Dag Sverre Seljebotn
>>>> One thing somebody *could* work on rather independently for some hours
>>>> is proper PEP 3118 support, as that is available in Python 2.6+ as well
>>>> and could be conditionally used on those systems.
>>> Yes, this could be done independently. I am not familiar with PEP
>>> 3118; from the python-dev ML, it looks like the current buffer API has
>>> some serious shortcomings, I don't whether this implies to numpy or
>>> not. Do you have more on this ?
>> Not sure what you refer to ...
> Thank you for those information.
> I don't understand what is meant by "not implemented for
> multi-dimensional array", and the consequences for numpy. Does it mean
> that PEP 3118 is not fully implemented ? Is the status of the buffer
> interface the same for python 2.6 and python 3 ?
The "memoryview" is not implemented on 2.6, but that's just a utility
for being able to acquire a buffer and inspect it from Python-space.
From Cython or C one still has access.
I think this just refers to there not being any multidimensional
consumers nor exporters in the standard library. So from the point of
view of the standard library it is a bit useless; but it is not if one
uses 3rd party libraries. The API itself is working fine, and you can
e.g. export a multidimensional buffer and use it in Cython (defined
__getbuffer__ for a cdef class and then access it through
classname[dtype, ndim=...]), under both 2.6 and 3.0.
More information about the Numpy-discussion