In Python 2.6 (or earlier), use the dict constructor:
d = dict((key, value) for (key, value) in sequence)
In Python 2.7+ or 3, you can just use the dict comprehension syntax directly:
d = {key: value for (key, value) in sequence}
You may also use:
d = {value: foo(value) for value in sequence}
http://stackoverflow.com/questions/1747817/python-create-a-dictionary-with-list-comprehension