A nice Python typo to have

I had this typo in my code, and it gives you the weirdest errors ever:

translation = range(20)
translation = [[i, str('Number %i' % i)] for i in range(20)]
print 'Translations set: ',[i[1] for i in translation]

#Split the list, so we only take the upper part
firstN = 5
print 'First %i translations' % firstN, [i[1] or i in translation[:firstN]]

If you have not seen the typo yet, what would you expect the output to be? The output is...

And the output is:

Translations set:  ['Number 0', 'Number 1', 'Number 2', 'Number 3', 'Number 4', 'Number 5', 'Number 6', 'Number 7', 'Number 8', 'Number 9', 'Number 10', 'Number 11', 'Number 12', 'Number 13', 'Number 14', 'Number 15', 'Number 16', 'Number 17', 'Number 18', 'Number 19']
First 5 translations ['Number 19']

Why? Simple if you know Python well. The last line contains a typo, it says or instead of for, and this would be detected if the loop variable wasn't running wild. Default Python behavior is to have a loop variable live outside of the scope of the loop. Sounds nice, because you can do:
for i in range(20):
  if i > 5:
    break
print i

And know that your loop made it to index 6. However, it becomes less clear when you use the mapping for loop, because the iteration variable is actually inside the square brackets. What happens is that the first translation loop will initialize i and leave it behind. i[1] will evaluate to True, and the second part of the or is ignored, leaving the last element of the translation list to appear on the screen.

Lesson to learn from all this? Always follow your loops with a del i, even after [i in something].