On Sat, May 11, 2013 at 10:41 PM, Danny Yoo wrote:
> On Fri, May 10, 2013 at 3:19 PM, Jim Mooney wrote:
>> 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?
>
> The gritty details say "yes":
>
> http://
On Fri, May 10, 2013 at 3:19 PM, Jim Mooney wrote:
> 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?
Hi Jim,
The gritty details say "yes":
http://docs.python.org/2/reference/compound_stmts.html#the-
On Fri, May 10, 2013 at 5:19 PM, Jim Mooney wrote:
> 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?
At the start of a for loop, the interpreter gets an iterator for the
iterable. The latter is evaluated
On 11/05/13 07:19, Jim Mooney wrote:
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 v
Jim Mooney wrote:
> 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.
>
>
On 05/10/2013 05:19 PM, Jim Mooney wrote:
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
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