[Numpy-discussion] Cython/NumPy syntax
Dag Sverre Seljebotn
Wed Aug 6 03:35:06 CDT 2008
Stéfan van der Walt wrote:
> 2008/8/6 Dag Sverre Seljebotn <firstname.lastname@example.org>:
>> - Require an ndim keyword:
>> cdef numpy.ndarray[numpy.int64, ndim=2]
> I'd definitely prefer a comma between the two, and an (optional) ndim
> keyword argument if possible.
I'm taking this as a vote in favor of this and against "2D" and <>?
The keyword is already present in optional form (you can do already do
"ndarray[ndim=3, dtype=numpy.int64]" if you want to). So I meant to ask
whether making it mandatory is a good solution so that the 2 doesn't
look like a length specifier.
(ndim=2 seems too long for me though, which is why I am pondering "2D".)
> Looking forward to hearing more!
It is looking bright and some experimental support will be present in
the next Cython release. What might be missing first time around is
support for complex numbers, records/structs and object dtypes.
(As there is (at least not yet) no native complex number support in
Cython you would need to handle a complex struct manually anyway. I was
hoping to fix this but I won't have time within the GSoC.)
More information about the Numpy-discussion