Use immutable arg rather mutable arg
Passing mutable objects as default args is a known Python pitfall. We'd better avoid this. This commit changes mutable default args with None, then use 'arg = arg or []'. Change-Id: I52a37bbc129fab40a99c919a837147d663941dce
This commit is contained in:
@@ -21,7 +21,9 @@ places where actual behavior differs from the spec.
|
|||||||
from keystoneclient import access
|
from keystoneclient import access
|
||||||
|
|
||||||
|
|
||||||
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()
|
keys = dict.keys()
|
||||||
for k in required:
|
for k in required:
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user