On Sun, Apr 4, 2010 at 5:20 PM, Paul Rubin <no.em...@nospam.invalid> wrote:
[...]
>
>    d[r] = list(r for r in [4,5,6])
>

This have a slightly performance difference. I think mainly the
generator's next() call.

In [1]: %timeit list(r for r in range(10000))
100 loops, best of 3: 2.78 ms per loop

In [2]: %timeit [r for r in range(10000)]
100 loops, best of 3: 1.93 ms per loop

~Rolando
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to