keystone/keystone/hacking
ChangBo Guo(gcb) d988d14801 Use dict comprehensions instead of dict constructor
PEP-0274 introduced dict comprehensions [1], these are benefits:
  The dictionary constructor approach has two distinct disadvantages
  from the proposed syntax though.  First, it isn't as legible as a
  dict comprehension.  Second, it forces the programmer to create an
  in-core list object first, which could be expensive.

Keystone dropped python 2.6 support in Kilo, we can leaverage this now.
There is deep dive about PEP-0274[2] and basic tests about
performance[3].

Note: This commit doesn't handle dict constructor with kwargs.
This commit also adds a hacking rule.

[1]http://legacy.python.org/dev/peps/pep-0274/
[2]http://doughellmann.com/2012/11/12/the-performance-impact-of-using-dict-instead-of-in-cpython-2-7-2.html
[3]http://paste.openstack.org/show/154798

Change-Id: Ie74719d0c969fa7819c243d5b162df6656c1e136
2015-03-02 13:14:03 +08:00
..
__init__.py Adds style checks to ease reviewer burden 2014-04-09 23:34:45 +00:00
checks.py Use dict comprehensions instead of dict constructor 2015-03-02 13:14:03 +08:00