I want to write some tests to analyse the efficiency of different operations in python, namely a comparison of dictionary comprehensions and dict generators.
To test
You can do it this way:
>>> words=['this','that','is','if','that','is','if','this','that'] >>> {i:words.count(i) for i in words} {'this': 2, 'is': 2, 'if': 2, 'that': 3}