I have a list of lists that I want to unpack in for loops, but I'm running into an issue.
>>> a_list = [(date(2010, 7, 5), ['item 1', 'item 2']), (date(2010, 7, 6), ['item 1'])]
>>>
>>> for set in a_list:
... a, b = set
... print a, b
...
2010-07-05 ['item 1', 'item 2']
2010-07-06 ['item 1']
>>>
>>> for set in a_list:
... for a, b in set:
... print a, b
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
TypeError: 'datetime.date' object is not iterable
How come the first one works, but the second one doesn't?