3 ms·
dict comprehensions were backported to 2.7 $ python2.7 Python 2.7.3 (default, Apr 13 2012, 13:51:30) >>> {i: i+1 for i in range(5)} {0: 1, 1:
by masklinn 14y ago
dict comprehensions were backported to 2.7
$ python2.7
Python 2.7.3 (default, Apr 13 2012, 13:51:30)
>>> {i: i+1 for i in range(5)}
{0: 1, 1: 2, 2: 3, 3: 4, 4: 5}