numpy/numpy — pull request #307 by pv (2012-06-11 21:06:02+00:00)
Title: BUG: don't pollute public namespace with customized PyIndex_Check on Py2.4

Move compatibility #define for PyIndex_Check on Python 2.4 to a private compat header

The problem is that including the public Numpy header "arrayobject.h" defines a compatibility wrapper for "PyIndex_Check" on Python 2.4. Moreover, this compatibility wrapper functions incorrectly... This #define probably should not be in the public namespace, as it already causes problems with Cython on Py2.4 (which we hit into in Scipy release):
http://permalink.gmane.org/gmane.comp.python.cython.devel/13983

The second commit moves all non Py3-stuff out of npy_3compat.h to another, more private compat header, for stylistic reasons (mainly because #defining `PyIndex_Check` to `0` rather than something like `PyNumber_Check` is possibly not the correct solution, but I didn't want to go changing it inside Numpy for this).

A question with this PR is --- is there 3rd party software out there that relies on Numpy headers defining the otherwise missing PyIndex_Check being defined, and do we care. I'd say we don't care, this seems like a corner case, and the current behavior in Numpy is wrong.