summaryrefslogtreecommitdiff
path: root/troveclient/compat
diff options
context:
space:
mode:
authorjiansong <jian.song@easystack.cn>2016-10-07 19:23:48 -0700
committerjian.song <jian.song@easystack.cn>2016-10-19 02:08:46 +0000
commit91e098e0ea46a7674f9d0fb6e4734675c658f444 (patch)
tree6108cb39c0c035e3c1ae6ad875a6ae598a096e90 /troveclient/compat
parenta06ad17715d06ad95d52430e489929d9d956adc6 (diff)
downloadpython-troveclient-91e098e0ea46a7674f9d0fb6e4734675c658f444.tar.gz
Avoid use xx=[] for parameter in function
Use xx = [] for the parameter for function, 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: Icbade7dd4c7d231ae65fd4f8de673b484bab721c
Diffstat (limited to 'troveclient/compat')
-rw-r--r--troveclient/compat/common.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/troveclient/compat/common.py b/troveclient/compat/common.py
index 152ea77..ec7854f 100644
--- a/troveclient/compat/common.py
+++ b/troveclient/compat/common.py
@@ -399,10 +399,10 @@ class Paginated(object):
next property you can use to get the next page of data.
"""
- def __init__(self, items=[], next_marker=None, links=[]):
- self.items = items
+ def __init__(self, items=None, next_marker=None, links=None):
+ self.items = items or []
self.next = next_marker
- self.links = links
+ self.links = links or []
def __len__(self):
return len(self.items)