Since the tuple is immutable, you need to delete the old one and create a new one. This works in Python 2 and 3, and it retains the original dict:
>>> d = {('Foo', 0): 0, ('Bar', 0): 0}
>>> for (k, j), v in list(d.items()):
... del d[k,j]
... d[(k.lower(), j)] = v
...
>>> d
{('foo', 0): 0, ('bar', 0): 0}
Note that in Python 2, dict.items () returns a copy of the list, so it does not need to be sent to the list, but I decided to leave it for full compatibility with Python 3.
, dict, dict . Python 2.7, 2.6 3.
>>> d = {('Foo', 0): 0, ('Bar', 0): 0}
>>> d = dict(((k.lower(), j), v) for (k, j), v in d.items())
>>> d
{('bar', 0): 0, ('foo', 0): 0}