On 9/8/10 2:22 PM, Jason Grout wrote:
On 9/8/10 2:15 PM, Simon King wrote:
Hi Jason!
On 8 Sep., 20:57, Jason Grout<[email protected]> wrote:
Actually, for a while now, "for i in range(...)" is translated into fast
C intelligently. In fact, I believe it's the recommended syntax now,
instead of 0<=i<...
Even if you do *not* cdefine "cdef int i"? That's new to me.
No, you still need to do cdef int i, I believe.
So:
cdef int i
for i in range(10):
....
should be fast.
Doc reference:
http://docs.cython.org/src/userguide/language_basics.html#integer-for-loops
http://docs.cython.org/src/userguide/pyrex_differences.html#automatic-range-conversion
Thanks,
Jason
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org