Skip to content

Instantly share code, notes, and snippets.

@tomoh1r
Created Aug 13, 2015
Embed
What would you like to do?
Python で辞書を作る
>>> timeit.timeit('{x: x for x in range(10000)}', number=1000)
0.5202829837799072
>>> timeit.timeit('dict((x, x) for x in range(10000))', number=1000)
1.0116031169891357
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment