News for hackers. Stuff that matters.
Re:Python Language Features and Tricks by mildtrepidation on Saturday March 08, 2014 @12:41PM (#7365754)
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.
Re:Python Language Features and Tricks by maxerickson on Saturday March 08, 2014 @12:49PM (#7365778)
Re:Python Language Features and Tricks by chingjun on Sunday March 09, 2014 @01:30PM (#7369090)
Wow I didn't know that! I was always doing something like this

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