$ python
Python 2.6 (r26:66714, Nov 3 2009, 17:33:38)
[GCC 4.4.1 20090725 (Red Hat 4.4.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {"val1":"val2", "val3":"val4", "val5":"val6"}
>>> b = dict([(a[x],x) for x in a])
>>> a
{'val3': 'val4', 'val1': 'val2', 'val5': 'val6'}
>>> b
{'val2': 'val1', 'val6': 'val5', 'val4': 'val3'}
>>> lst = {"val1":"val2", "val3":"val4", "val5":"val6"}
>>> lst
{'val3': 'val4', 'val1': 'val2', 'val5': 'val6'}
>>> {a[1]:a[0] for a in lst}
{'a': 'v'}
Это должно быть с items(), как тебе выше писали.
>>> {a[1]:a[0] for a in lst.items()}
{'val2': 'val1', 'val6': 'val5', 'val4': 'val3'}
Согласен, мой вариант без дополнительного преобразования в dict() будет лучше выглядеть.
$ python
Python 2.7.5 (default, Nov 3 2014, 14:26:24)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = {"val1":"val2", "val3":"val4", "val5":"val6"}
>>> b = {a[x]:x for x in a}
>>> a
{'val3': 'val4', 'val1': 'val2', 'val5': 'val6'}
>>> b
{'val2': 'val1', 'val6': 'val5', 'val4': 'val3'}