← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1525903] [NEW] should not use mutable default arguments

 

Public bug reported:

We should not use mutable default arguments in function definitions due
to the "Common Gotchas"[1].

So,  we must remove the default arguments "[]" when the function is defined, such as this function:
https://github.com/openstack/horizon/blob/master/openstack_dashboard/utils/metering.py#L178

[1]: http://docs.python-guide.org/en/latest/writing/gotchas/

** Affects: horizon
     Importance: Undecided
     Assignee: javeme (javaloveme)
         Status: In Progress

-- 
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/1525903

Title:
  should not use mutable default arguments

Status in OpenStack Dashboard (Horizon):
  In Progress

Bug description:
  We should not use mutable default arguments in function definitions
  due to the "Common Gotchas"[1].

  So,  we must remove the default arguments "[]" when the function is defined, such as this function:
  https://github.com/openstack/horizon/blob/master/openstack_dashboard/utils/metering.py#L178

  [1]: http://docs.python-guide.org/en/latest/writing/gotchas/

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


Follow ups