From 12be3210eb2bd0ab3385f2a4216958cade126add Mon Sep 17 00:00:00 2001 From: jiansong Date: Sat, 24 Sep 2016 19:24:33 -0700 Subject: [PATCH] Avoid use xx=[] for parameter initial value Use xx = [] for the parameter initial value, this parameter will only be initialized at the first call, this is should be avoided. Better choice is to set the initial value to None, then the initialization time use xx= xx or [] more information:http://effbot.org/zone/default-values.htm Change-Id: Ia89b9741731c07d8bf08691a1c6544742625cad6 --- troveclient/tests/fakes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/troveclient/tests/fakes.py b/troveclient/tests/fakes.py index 008e59f6..e084cadd 100644 --- a/troveclient/tests/fakes.py +++ b/troveclient/tests/fakes.py @@ -24,7 +24,9 @@ def get_version_map(): } -def assert_has_keys(dict, required=[], optional=[]): +def assert_has_keys(dict, required=None, optional=None): + required = required or [] + optional = optional or [] keys = dict.keys() for k in required: try: