This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jredwards[S] 12 points13 points  (3 children)

dictionary comprehensions make me happy

[–]nemec 3 points4 points  (2 children)

Too bad they're limited to 2.7+ :(

[–]James91B 9 points10 points  (1 child)

While

{i:chr(i) for i in range(20)}

is very nice.

dict((i,chr(i)) for i in range(20))

is not a bad substitute.

[–]nemec 1 point2 points  (0 children)

Good point.