if you adapt npy_binsearch to take an array instead of the sortCompare and then use its compare member you should be able to remove it. Should be similar to how the old searchsorted worked.