News for hackers. Stuff that matters.
Re:Functional Programming in Python [pdf] by devy on Friday July 24, 2015 @06:04PM (#9945484)
The #1 and #2 expressions yields different results.

>>> dict([n, 2 n] for n in range(5)) {0: 1, 1: 2, 2: 4, 3: 8, 4: 16} >>> { n: n 2 for n in range(5) } {0: 0, 1: 1, 2: 4, 3: 9, 4: 16}

There are no comments on this comment yet.