]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Leverage dict comprehension in PEP-0274
authorChangBo Guo(gcb) <eric.guo@easystack.cn>
Wed, 24 Dec 2014 14:42:58 +0000 (22:42 +0800)
committerChangBo Guo(gcb) <eric.guo@easystack.cn>
Fri, 22 May 2015 02:06:00 +0000 (10:06 +0800)
commit5800f25f7e615b40fdaa6e0be8096d8fab1b5566
treed1bcd89283b940d76eec9b46fb7a2ff10d6dd03f
parentc2db466995d5e534b6cc87fae917d7ec9109a18c
Leverage dict comprehension in PEP-0274

PEP-0274 introduced dict comprehensions to replace dict constructor
with a sqeuence of key-pairs[1], these are benefits:
  First, it makes the code look neater.
  Second, it gains a micro-optimization.

Cinder dropped python 2.6 support in Kilo, we can leverage this now.
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/

Change-Id: Ie65796438160b1aa1f47c8519fb9943e81bff3e9
19 files changed:
HACKING.rst
cinder/api/contrib/quotas.py
cinder/api/v1/limits.py
cinder/api/v1/volumes.py
cinder/api/v2/limits.py
cinder/api/v2/views/volumes.py
cinder/db/sqlalchemy/api.py
cinder/hacking/checks.py
cinder/quota.py
cinder/tests/unit/api/v1/test_limits.py
cinder/tests/unit/api/v2/test_limits.py
cinder/tests/unit/test_db_api.py
cinder/tests/unit/test_gpfs.py
cinder/tests/unit/test_hacking.py
cinder/tests/unit/test_quota.py
cinder/tests/unit/test_volume.py
cinder/tests/unit/test_volume_glance_metadata.py
cinder/volume/api.py
cinder/volume/drivers/ibm/flashsystem.py