[Cython] improving Py <-> C conversion of numeric types
Robert Bradshaw
robertwb at math.washington.edu
Thu Mar 19 19:36:36 CET 2009
On Mar 19, 2009, at 6:57 AM, Lisandro Dalcin wrote:
> On Thu, Mar 19, 2009 at 3:18 AM, Robert Bradshaw
> <robertwb at math.washington.edu> wrote:
>>>
>>> But an anon enum has no name!
>>
>> Oh, now I see what you're asking about. Yes, let's just return "int"
>> in this special case.
>>
>
> Let's leave this for the time I restart my work on C<->Py conversions
> of integral types...
>
> Anon enums are currently the only way to enforce "constness" on
> external declararions... I have fear of braking user code.
>
> This is yet other more thing we have to improve... "const" keyword
> should be accepted and handled at least in external declarations, in
> such a way that we can write
>
> cdef extern from ""someheader.h"
> const long LONG_MAX
> const size_t SIZEOF_SOMETHING
> const double PI
>
> or perhaps:
>
> cdef extern from ""someheader.h"
> const:
> long LONG_MAX
> size_t SIZEOF_SOMETHING
> double PI
>
> Unfortunately, I doubt I could implement this myself...
Yes, this is an oft requested feature.
http://trac.cython.org/cython_trac/ticket/246
- Robert
More information about the Cython-dev
mailing list