remove the default arguments "[]"
remove the default arguments "[]" when the function is defined. ref: http://docs.python-guide.org/en/latest/writing/gotchas/ Closes-Bug: #1525903 Change-Id: I241f22fe10e535bb50f7ce27fac09d6448fd2bb2
This commit is contained in:
parent
590f7e4d69
commit
db8e206bee
@ -268,7 +268,7 @@ class Column(html.HTMLElement):
|
||||
)
|
||||
|
||||
def __init__(self, transform, verbose_name=None, sortable=True,
|
||||
link=None, allowed_data_types=[], hidden=False, attrs=None,
|
||||
link=None, allowed_data_types=None, hidden=False, attrs=None,
|
||||
status=False, status_choices=None, display_choices=None,
|
||||
empty_value=None, filters=None, classes=None, summation=None,
|
||||
auto=None, truncate=None, link_classes=None, wrap_list=False,
|
||||
@ -276,6 +276,7 @@ class Column(html.HTMLElement):
|
||||
update_action=None, link_attrs=None,
|
||||
cell_attributes_getter=None, help_text=None):
|
||||
|
||||
allowed_data_types = allowed_data_types or []
|
||||
self.classes = list(classes or getattr(self, "classes", []))
|
||||
super(Column, self).__init__()
|
||||
self.attrs.update(attrs or {})
|
||||
|
@ -551,7 +551,8 @@ class RouterActionTests(RouterMixin, test.TestCase):
|
||||
def test_router_addinterface_exception(self):
|
||||
self._test_router_addinterface(raise_error=True)
|
||||
|
||||
def _test_router_addinterface_ip_addr(self, errors=[]):
|
||||
def _test_router_addinterface_ip_addr(self, errors=None):
|
||||
errors = errors or []
|
||||
router = self.routers.first()
|
||||
subnet = self.subnets.first()
|
||||
port = self.ports.first()
|
||||
@ -561,7 +562,8 @@ class RouterActionTests(RouterMixin, test.TestCase):
|
||||
self._check_router_addinterface(router, subnet, ip_addr)
|
||||
|
||||
def _setup_mock_addinterface_ip_addr(self, router, subnet, port,
|
||||
ip_addr, errors=[]):
|
||||
ip_addr, errors=None):
|
||||
errors = errors or []
|
||||
subnet_get = api.neutron.subnet_get(IsA(http.HttpRequest), subnet.id)
|
||||
if 'subnet_get' in errors:
|
||||
subnet_get.AndRaise(self.exceptions.neutron)
|
||||
|
@ -175,7 +175,8 @@ def get_unit(meter, request):
|
||||
|
||||
class ProjectAggregatesQuery(object):
|
||||
def __init__(self, request, date_from, date_to,
|
||||
period=None, additional_query=[]):
|
||||
period=None, additional_query=None):
|
||||
additional_query = additional_query or []
|
||||
if not period:
|
||||
period = calc_period(date_from, date_to)
|
||||
if date_from:
|
||||
|
Loading…
Reference in New Issue
Block a user