I'm trying to use PyArray_SearchSorted
using NumPy's C API from Cython.
When call it like PyArray_SearchSorted(values, point, NPY_SEARCHLEFT)
I get the GCC error: error: too few arguments to function call, expected 4, have 3
.
On the other hand, when I call it like PyArray_SearchSorted(values, point, NPY_SEARCHLEFT, NULL)
, Cython supplies an error: Call with wrong number of arguments (expected 3, got 4)
.
Looking more closely, it appears there is a discrepancy between the function signature as currently defined in NumPy and as defined in Cython's includes.
I know the sorter
argument for searchsorted only appeared in NumPy 1.7.0, but isn't backwards compatibility one of the guarantees with the NumPy C API? Or is this just a Cython bug?
In case it matters, I'm using Cython 0.21.1, NumPy 1.9.1 and Python 2.7 from conda on OS X.