On Jan 15, 1:06 pm, Paul Rubin <http://phr...@nospam.invalid> wrote: > I just looked up Cython and see that it's based on Pyrex. Worth > knowing about, I guess; but basically I think C is evil.
I feel much the same way, but the recent modifications to Cython that provide a "pure Python"[1] approach mean that you can minimise the amount of C you need to write and still take advantage of features like static types: @cython.locals(s=cython.double, i=int, n=int) def harmonic_sum(n): s = 0 for i in range(1, n+1): s += 1.0 / i return s The same code will both run in Python and compile via Cython. (I'm surprised the new "pure" approach isn't more clearly promoted on the site.) 1: http://wiki.cython.org/pure -- http://mail.python.org/mailman/listinfo/python-list