I\'ve been loving the tuple comprehensions added to Python3.5:
In [128]: *(x for x in range(5)),
Out[128]: (0, 1, 2, 3, 4)
However, when I
Pass a generator expression into the tuple() constructor, since there are no tuple-comprehensions:
{idx: tuple(x for x in range(5)) for idx in range(5)}
Tuple-comprehensions don't exist, but even though list-comprehensions do ([... for ... in ...]) they are similar to*: list(... for ... in ...).
*list comprehensions are actually faster than a generator expression passed into a constructor function as executing functions is expensive in Python