Hacker News new | ask | show | jobs
by mildtrepidation 4481 days 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.
2 comments

Wow I didn't know that! I was always doing something like this

    mi = dict((v,k) for k,v in m.iteritems())