[Cython] about numpy, c/python namespaces and name clashes, and some tricks ; -)
Dag Sverre Seljebotn
dagss at student.matnat.uio.no
Tue May 13 10:00:15 CEST 2008
Lisandro Dalcin wrote:
> I saw some previous posts complaining about using numpy and some name
> clashes about 'strides', and other stuff like that...
Yes, that was me, but it was mostly a philosophical point :-)
> Well, as time pass, I like Cython more and more, because nasty names
> and name clashes can be easyly fixed. For example, lest see some code
> that uses the convention 'cxxxx' for accession at the Cython C-level
> what in python is a 'xxxxx' member (eg. 'cshape' and 'shape'). This is
> so easy for me that I will never mind about requiring the numpy
> headers to change.
Great! I like the convention and the names you picked. I'll use the same
names in the pxd that I will end up signing off after this summer's
Summer of Code [1].
Still, it would be nice to ship this as an "official" numpy.pxd before
that. I can then make a promise that any code written using it will be
forwards-compatible with my pxd after the summer (which I can't do with
the current one that the NumPy project ships).
One way of going about it is discussed in CEP 106
(http://wiki.cython.org/declaration). I personally prefer this over
having the NumPy project ship it for now, as numpy.pxd will be in heavy
development tightly coupled with the latest Cython releases. What do you
think? It basically boils down to putting it in the Includes directory
in the Cython repo (though Cython doesn't seem to automatically add this
to the include path, perhaps that can be done?)
[1]: http://wiki.cython.org/DagSverreSeljebotn/soc
--
Dag Sverre
More information about the Cython-dev
mailing list