On May 10, 2008, at May 10:8:34 AM, Stefan Behnel wrote:
> Brian Blais wrote:
>> In python, I am used to syntax:
>>
>> for var in stuff:
>>
>> where my eye finds "var" and then "stuff", so I first find out the
>> relevant variable, and then the values it will take.
>>
>> in old pyrex syntax,
>>
>> for var in begin<= var < end:
>>
>> my eye finds "var" and then "begin" and "end", so I first find out
>> the
>> relevant variable, and then the values it will take.
>
> Actually, in the old Pyrex syntax, it was
>
> for var *from* begin <= var < end:
ooops, my bad. :)
>
> so maybe the whole discussion is somewhat pointless anyway. I don't
> quite see
> why we shouldn't just always convert
>
> for var in range(begin, end):
>
> to
>
> for var in begin <= var < end:
>
> *iff* var is cdef-ed as a C integer type. According to Robert,
> there's a
> difference if the loop overflows, but that case is almost certainly a
> programming error when var is a C type, and there is no such thing
> as Python
> compatibility for C variables anyway.
>
that would be great!
bb
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev