[Matrix-SIG] An area where the C-API for NumPy 1.12 is not 100% compatible

David Ascher da@ski.org
Wed, 1 Sep 1999 21:01:23 -0700 (Pacific Daylight Time)


On Wed, 1 Sep 1999, Travis Oliphant wrote:

> I just got bit by an area where NumPy 1.12 is not 100% compatible with
> older versions when using it in C.
> 
> If you use the O! syntax in PyArg_ParseTuple to check for array object
> arguments (by using &PyArray_Type as the extra argument) you will have
> trouble with your extension module with the NumPy 1.12 release since the
> object passed is now a subclass of the extension class.  
> 
> I don't know of an easy fix other than using O& with a converter function
> that uses PyArray_Check to check or going to the old 
> check-each-argument-manually approach.
> 
> If anyone knows of a better approach let me know.

Ouch. I can't think of a solution that doesn't involve patching the core.

If you write the converter function, let me know and I'll include it
somewhere relevant.

--david ascher