Re: [Cython] Correct way of defining enums

2011-11-30 Thread Stéfan van der Walt
On Tue, Nov 29, 2011 at 11:15 PM, Robert Bradshaw wrote: > The problem was that NPY_SEARCHSIDE wasn't defined as a type, so it > was treating that as the argument name (implicitly typed to be > object). > > https://github.com/cython/cython/commit/5ba30c45c7d3478f7b7d0490e720fb0a184c6050 Thanks fo

Re: [Cython] Correct way of defining enums

2011-11-29 Thread Stéfan van der Walt
On Tue, Nov 29, 2011 at 9:08 PM, Greg Ewing wrote: > Did you try both together? I.e. > >  cdef extern from "ndarraytypes.h": >    ctypedef enum NPY_SEARCHSIDE: >      NPY_SEARCHLEFT = 0 >      NPY_SEARCHRIGHT = 1 Yeap, no luck :( Does this work on your system? Stéfan ___

Re: [Cython] Correct way of defining enums

2011-11-29 Thread Stéfan van der Walt
Hi Licandro On Tue, Nov 29, 2011 at 10:32 AM, Lisandro Dalcin wrote: > This is (near to, see below) the right way, as that NumPy enum do is > declared in NumPy headers. > > Try "ctypedef enum ..." Unfortunately, that doesn't work either :/ (Same error message, no matter which incantation, Cytho

[Cython] Correct way of defining enums

2011-11-28 Thread Stéfan van der Walt
Hi all, What is currently the correct way of defining an enum? I am trying to call a NumPy function with an enum as its third argument, and the following does not compile: cimport numpy as np np.import_array() cdef enum NPY_SEARCHSIDE: NPY_SEARCHLEFT = 0 NPY_SEARCHRIGHT = 1 cdef sort_so

Re: [Cython] Speed of cython.compile

2011-09-20 Thread Stéfan van der Walt
On Tue, Sep 20, 2011 at 10:26 PM, Robert Bradshaw wrote: > OK, I just pushed a commit that should speed things up a lot. There's > still a lot of overhead in calling a @cython.compile method that could > be trimmed, but it's nowhere near as extreem as it used to be. Fantastic--it's much, much bet

[Cython] Mailing list address on webpage

2011-09-20 Thread Stéfan van der Walt
Hi all, The mailing list address on the cython.org front page still points to codespeak. I enjoyed the release message. Arr! :) Regards Stéfan ___ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel

[Cython] Speed of cython.compile

2011-09-19 Thread Stéfan van der Walt
Hi all, I only recently found out that the mailing list had shifted, so I hope my message reaches you this time! On the current development version of Cython, the attached script makes Cython go into an infinite loop, but let's hope that's just on my machine. Regards Stéfan -- Forwarded