[Tutor] range efficiency
Jim Mooney
cybervigilante at gmail.com
Fri May 10 23:19:25 CEST 2013
If I'm using a variable-dependent range in a for loop, is Python smart
enough to figure the variable once so I don't have to hoist it up?
That is for c in range(0,x+2), is x+2 figured once or every time
through the loop? I'm assuming it's once but I like to verify.
I'll figure this myself once I get an editor I like with a profiler,
but I'm still trying editors and don't want to spend all my time on
them. So far I'm in between too simple, overkill, or buggy. And I
don't want anything that uses Java. I'm allergic to Java ;')
--
Jim Mooney
“For anything that matters, the timing is never quite right, the
resources are always a little short, and the people who affect the
outcome are always ambivalent.”
More information about the Tutor
mailing list