Question about consistency in python language

Sam Pointon free.condiments at gmail.com
Thu Sep 8 19:50:44 EDT 2005


update updates the dictionary in place - it actually returns None, not
the updated dict. However, you can construct a dictionary from a list
of (key, value) pairs using dict(list). Example:

>>>l = [('foo', 'bar'), ('baz', 'qig')]
>>>d = dict(l)
>>>print d
{'foo': 'bar', 'baz': 'qig'}




More information about the Python-list mailing list