[Numpy-discussion] __array__struct__: about using PyCapsule instead of PyCObject for Python 2.7

Pauli Virtanen pav@iki...
Sat Jul 17 09:51:56 CDT 2010

Wed, 30 Jun 2010 12:13:38 -0600, Charles R Harris wrote:
>> > Grrr... I didn't see the point, myself, I'm tempted to deprecate 2.7
>> > just
>> to
>> > get even. There are some routines in the numpy/core/src includes that
>> > you might want to copy, they will allow you to use a common interface
>> > for PyCObject and PyCapsule if you need to do that.
>> >
>> >
>> I've already fixed my code for PyCapsule. What's not clear to me is how
>> to build (i.e, use the old cobject or the new capsules)
>> __array_struct__ across NumPy and Python versions combinations. Will
>> NumPy 1.x series ever support Python 2.7? In such case, should I use
>> cobjects or capsules?
> We do support 2.7, but with PyCapsule. You might want to take a look at
> f2py also, as it also uses PyCapsule for Python >= 2.7.

I think we need to change this decision. PyCObject is still available on 
Python 2.7, and will only raise a PendingDeprecationWarning, which does 
not show up by default. I believe the Python devs reversed the full 
deprecation before the final 2.7 release.

So I think we should just stick with PyCObject on 2.x, as we have done so 
far. I'll just bump the version checks so that PyCapsule is used only on 

I'll commit this to Numpy SVN soon.

Pauli Virtanen

More information about the NumPy-Discussion mailing list