Dave Farrance schrieb am 23.02.2015 um 15:13: > Dave Cook wrote: >> On 2015-02-22, Dave Farrance wrote: >> >>> It's still quicker to do a re-write in the more cumbersome C >> >> You should try Cython. > > I did try Cython when I was trying to figure out what to do about the slow > speed. My initial attempt showed no speedup at all. The documentation > told me that I needed to change the data types to special C-like types, so > it seemed to me that it would become half way between Python and C and > would be as cumbersome to develop as C. So at that point, I just rewrote > it in C.
The main selling point of Cython is that, while it gives you the speed of C if you write C-ish code (because it translates it to the obvious C code), you don't have to write that C-ish code unless you decide to do so. Right the next line, you can use a set comprehension or yield a value back from a generator. So, it's not "half way between Python and C", it actually covers both, almost entirely. (Oh, and also C++, if you feel like it.) Stefan -- https://mail.python.org/mailman/listinfo/python-list