3 ms·
When did support for dictionary comprehensions make it into 2.x? I could've sworn it didn't used to work, but I just tried it in the shell and sure enough, it d
by mildtrepidation 13y ago
When did support for dictionary comprehensions make it into 2.x? I could've sworn it didn't used to work, but I just tried it in the shell and sure enough, it does in 2.7.3.
- maxerickson 13y ago2.7: http://legacy.python.org/dev/peps/pep-0274/ http://legacy.python.org/dev/peps/pep-0274/
- chingjun 13y agoWow I didn't know that! I was always doing something like this mi = dict((v,k) for k,v in m.iteritems())