On Mar 18, 2009, at 1:07 PM, Anoop Saldanha wrote: > On Thu, Mar 19, 2009 at 1:20 AM, Robert Bradshaw > <[email protected]> wrote: > There's a lot of work going on with loops right now, I've also > discovered http://trac.cython.org/cython_trac/ticket/243 . Another > problem is that we haven't nailed down exactly what the semantics for > the for...from loop should be. Should it be a C loop (where the > endpoint and step are re-evaluated every time, and changing the index > variable from the loop body modifies the loop behavior) or simply > alternative syntax for the for...in range() loop. I would say the > latter, (use a while loop if one wants the other behavior) but > certainly not some hybrid like we have now. > > - Robert > > Won't ticket 203 solution apply for this too? As in using a temp > variable? And like Dag told you can use freeze_endpoints, so that > we can confine it only for range optimizations.
Yes, #203 is very relevant, which is why I'm not just jumping in and fixing it and duplicating effort. My points are that freeze_endpoints should always be true (i.e. it shouldn't even be an option) and that the loop variable itself should be a temp, not exposed to the user. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
