[Numpy-discussion] Py3k: making a py3k compat header available in installed numpy for scipy

Pauli Virtanen pav at iki.fi
Tue Mar 30 02:51:05 EDT 2010

2010/3/30 David Cournapeau <david at silveregg.co.jp>
> Pauli Virtanen wrote:
> > At least, I don't see what I would like to change there. The only thing
> > I wouldn't perhaps like to have in the long run are the PyString and
> > possibly PyInt redefinition macros.
> I would also prefer a new name, instead of macro redefinition, but I can
> do it.

For strings, the new names are "PyBytes", "PyUnicode" and "PyUString"
(unicode on Py3, bytes on Py2). One of these should be used instead of PyString
in all places, but redefining the macro reduced the work in making a
port of numpy.

For integers, perhaps a separate "PyInt on Py2, PyLong on Py3" type should
be defined. Not sure if this would reduce work in practice.

> The header would not be part of the public API proper anyway (I
> will put it somewhere else than numpy/include), it should never be
> pulled implicitly in when including one of the .h in numpy/include.



More information about the NumPy-Discussion mailing list