[Cython] planning for 0.17

Stefan Behnel stefan_ml at behnel.de
Wed Jun 27 15:09:32 CEST 2012


mark florisson, 27.06.2012 15:03:
> On 27 June 2012 13:48, Stefan Behnel wrote:
>> mark florisson, 27.06.2012 14:17:
>>> That works for me, as long and array is cimported from cpython (as
>>> 'array' or some other name). It will patch __Pyx_GetBuffer with a
>>> typecheck and a call to its __getbuffer__ method.
>>
>> For the memoryview_type and array_type checks, wouldn't a type identity
>> test be enough instead of a PyObject_TypeCheck() ?
> 
> Well, you want it to work for subclasses as well.

Fine with me.


> I think the only
> thing that doesn't work (pre-2.6), is overriding __getbuffer__ in a
> subclass outside of the module or pxd. For memoryviews, since each
> module has a different memoryview type, I inject a capsule in tp_dict,
> which __Pyx_GetBuffer checks for (it's called __pyx_getbuffer and
> __pyx_releasebuffer).

I'm sure it'll be a lot of fun to rip that out when we finally drop support
for Python 2.5 ...

Stefan


More information about the cython-devel mailing list