[Cython] Type casts
William Stein
wstein at gmail.com
Sat Feb 2 06:55:40 CET 2008
On Feb 1, 2008 7:12 PM, Robert Bradshaw <robertwb at math.washington.edu> wrote:
> Currently, in Cython, when x is a python object, <int>x gives the
> address of x. This is counter-intuitive and rarely useful. (When it
> is, one can always do <size_t><void *>x).
>
> I would propose making <type>x do a conversion (the same as cdef type
> y = x would) whenever type is a non-object type and x isn't, or vica-
> versa. Between C types it already behaves this way, and between
> Python objects it already has special meaning.
>
> I would also propose something like
>
> <ExtensionType?>x to be a cast into type ExtensionType *with* type
> checking.
>
> Thoughts?
+1 to both suggestions.
(I'm also testing that I can post to this list.)
By the way, I've talked with a lot of people about Cython
in the last week, and this is definitely a very important
project that's going to get more and more use. And it
doesn't hurt for this project that: "TIOBE Software
(http://www.tiobe.com/tpci.htm): TIOBE declares Python as programming
language of 2007! ["Python has been declared as programming language
of 2007. It was a close finish, but in the end Python appeared to have
the largest increase in ratings in one year time (2.04%). There is no
clear reason why Python made this huge jump in 2007. Last month Python
surpassed Perl for the first time in history, which is an indication
that Python has become the "de facto" glue language at system level.
It is especially beloved by system administrators and build managers.
Chances are high that Python's star will rise further in 2008, thanks
to the upcoming release of Python 3."
---
By the way, why did we switch to cython-dev at codespeak.net ?
I don't even remember that happening.
-- William
More information about the Cython-dev
mailing list