I don't understand why this works:
a = [(1,2)]
for x, y in a:
print x, y
And this doesn't:
a = ((1,2))
for x, y in a:
print x, y
I believe what happens in the first case is we create an iterator that returns a single value, (1,2). That tuple is unpacked, assigning 1 to x and 2 to y.
In the second, why doesn't the exact same thing happen?