← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1471349] Re: Eliminate default value as a mutable object

 

Reviewed:  https://review.openstack.org/225613
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=7023050eddc9b2361bd200309329e4e6bf89709d
Submitter: Jenkins
Branch:    master

commit 7023050eddc9b2361bd200309329e4e6bf89709d
Author: Timur Sufiev <tsufiev@xxxxxxxxxxxx>
Date:   Mon Sep 21 13:22:59 2015 +0300

    Eliminate mutable default arguments
    
    The best practice in Python is not to use mutable object (i.e. list,
    dictionary, or instances of most classes) as value of default
    argument (see https://goo.gl/Kwhg0T). A hacking rule to enforce this
    practice is added as well.
    
    The patch was inspired by CR https://review.openstack.org/#/c/198465/
    and took most of its code from it as well. That's why original
    copyrights are kept.
    
    Closes-Bug: #1471349
    Change-Id: Ia77b1736dbc3d4e28ff2d2c3424e9cfcaefa5077


** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1471349

Title:
  Eliminate default value as a mutable object

Status in OpenStack Dashboard (Horizon):
  Fix Released
Status in Magnum:
  Fix Released

Bug description:
  The default value is evaluated only once. This makes a difference when
  the default is a mutable object such as a list, dictionary, or
  instances of most classes. Magnum should follow what Python suggests:
  Do not to use mutable object as a default value.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1471349/+subscriptions