fixes use the fact that empty sequences are false

Bug #1156472 reported by shu, xinxin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Wishlist
wanghong

Bug Description

For sequences, (strings, lists, tuples), use the fact that empty sequences are false( PEP 8 Programming Recommendations)

Yes: if not seq:
     if seq:

No: if len(seq)
    if not len(seq)

Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Wishlist
status: New → Triaged
shu, xinxin (xinxin-shu)
Changed in keystone:
assignee: nobody → shu, xinxin (xinxin-shu)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/24955

Changed in keystone:
status: Triaged → In Progress
Revision history for this message
Dolph Mathews (dolph) wrote :

Unassigning due to inactivity.

Changed in keystone:
assignee: shu, xinxin (xinxin-shu) → nobody
status: In Progress → Triaged
wanghong (w-wanghong)
Changed in keystone:
assignee: nobody → wanghong (w-wanghong)
wanghong (w-wanghong)
Changed in keystone:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/63884
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=3c66870de29c4d79831da6d05236919cf318c379
Submitter: Jenkins
Branch: master

commit 3c66870de29c4d79831da6d05236919cf318c379
Author: wanghong <email address hidden>
Date: Tue Dec 24 16:04:13 2013 +0800

    Fix use the fact that empty sequences are false.

    For sequences(strings, lists, tuples), in order to consistent with
    pep8 recommendations, 'if len(seq)' should be replaced with 'if seq',
    and 'if not len(seq)' should be replaced with 'if not seq'.

    Change-Id: Ieb2c90b7f87b54361a2c291a838550227fde9fbe
    Closes-Bug: #1156472

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.