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 {}', 'arg = arg or []'. For unit code which
doesn't use the args , just set with None. This commit also adds hacking
check.
Reviewed: https:/ /review. openstack. org/240455 /git.openstack. org/cgit/ openstack/ octavia/ commit/ ?id=76e1e02e15b f83a7ac4ca01bfb 2f6665975829c9
Committed: https:/
Submitter: Jenkins
Branch: master
commit 76e1e02e15bf83a 7ac4ca01bfb2f66 65975829c9
Author: Bertrand Lallau <email address hidden>
Date: Fri Oct 30 08:11:46 2015 +0100
Removes the use of mutables as default args
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 {}', 'arg = arg or []'. For unit code which
doesn't use the args , just set with None. This commit also adds hacking
check.
Change-Id: Ib4f195c9c00ca2 c49579f9d62648b ff7c8109fcf
Closes-Bug: #1327473