django/django — pull request #3282 by tchaumeny (2014-09-26 13:46:55+00:00)
Title: Replaced set([foo, ...]) by {foo, ...} literals.

Using literals is optimal as it avoids a list instanciation and a function call — this won't make any big performance difference but since it also is the nominal way to create a set in Python2.7+ and does not affect lisibility there is no reason not to use it.

For reference:
```bash
$ python2.7 -m timeit -n 1000000 -r 5 -v 'set(["foo", "bar", "baz", "qux"])'
raw times: 0.784 0.678 0.686 0.753 0.777
1000000 loops, best of 5: 0.678 usec per loop

$ python2.7 -m timeit -n 1000000 -r 5 -v '{"foo", "bar", "baz", "qux"}'
raw times: 0.198 0.207 0.19 0.237 0.274
1000000 loops, best of 5: 0.19 usec per loop
```

See also http://doughellmann.com/2012/11/12/the-performance-impact-of-using-dict-instead-of-in-cpython-2-7-2.html