[issue9240] different behaviour with for loop... interpreted vs scripted

2010-07-13 Thread Eric Smith
Eric Smith added the comment: Excellent explanation. It's just a misunderstanding of how the language works, so nothing to do here. Closing. -- nosy: +eric.smith resolution: -> invalid status: pending -> closed ___ Python tracker

[issue9240] different behaviour with for loop... interpreted vs scripted

2010-07-13 Thread Ezio Melotti
Ezio Melotti added the comment: "for j in range(1,5), i in range(120,500,12):" is equivalent to "for j in (range(1,5), i in range(120,500,12)):" so the sequence here is a tuple that contains range(1,5) as first element and "i in range(120,500,12)" as second element. Since 'i' is needed before t

[issue9240] different behaviour with for loop... interpreted vs scripted

2010-07-12 Thread Diego Jacobi
New submission from Diego Jacobi : Hi. I am not a python expert and i was trying to reduce this next code: data = [] i = 0 for j in range(packetlen+1): print i, self.channels_in[ channels[i] ] data.append( self.channels_in[ channels[i] ].pop() )