Dag Sverre Seljebotn wrote:
> Andrew Straw wrote:
>> Dag Sverre Seljebotn wrote:
>>> Stefan Behnel wrote:
>>>   
>>>> Hi,
>>>>
>>>> the buffer API changed in Py3b3, without updating the PEP. The reasoning
>>>> behind the changes were discussed in full length here:
>>>>
>>>> http://bugs.python.org/issue3139
>>>>
>>>> Here's an incomplete patch that updates the struct, but that's definitely 
>>>> not
>>>> enough, so I hope that Dag finds some time to fix things up.
>>>>     
>>> Yes, I do; consider this assigned to me.
>> Great. I had been playing with an implementation already for b3, but 
>> it's segfaulting all over the place, and I'm having to learn a lot of 
>> details before I can understand things. I think it should be a lot 
>> easier for you. Anyhow another point/question -- 2.6b3 supports 
>> everything that 3b3 supports, but it's not clear to me that the various 
>> C preprocessor conditionals emitted by Cython will result in the Cython 
>> emulation of PyObject_GetBuffer() or the real thing for 2.6.
> 
> Emulation is done if the type slots are not supported in your Python -- 
> last time I checked Python 2.6 had to be emulated.
> 

The type slots are there in 2.6. Include/object.h of 2.6b3 includes the 
lines:

typedef struct {
         readbufferproc bf_getreadbuffer;
         writebufferproc bf_getwritebuffer;
         segcountproc bf_getsegcount;
         charbufferproc bf_getcharbuffer;
         getbufferproc bf_getbuffer;
         releasebufferproc bf_releasebuffer;
} PyBufferProcs;

And, I just checked -- it looks like the preprocessor conditionals for 
2.6 are wrong -- an implementation of __Pyx_GetBuffer() is made as for 
2.5 (rather than using PyObject_GetBuffer() like with 3.0).

-Andrew
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to