As I try to debug a strange problem in a Django view, I notice a stray comma after a dictionary definition. So I jump over to a python shell, and guess what? Ending a literal dict with a comma creates a tuple.
>>> d = {1:'foo'},
>>> type(d)
<type 'tuple'>
>>> d
({1: 'foo'},)
>>>