Ensure default arguments are not mutable
* add hacking check: no_mutable_default_args()
* remove the mutable default arguments "[]" or "{}" when the function
is defined.
ref: http://docs.python-guide.org/en/latest/writing/gotchas/
Closes-Bug: #1530282
Change-Id: Ice6f7654211b73d7f8bc3ca0e4dfae3dca354397
This commit is contained in:
@@ -26,6 +26,7 @@ Imports
|
||||
Dictionaries/Lists
|
||||
------------------
|
||||
|
||||
- [S360] Ensure default arguments are not mutable.
|
||||
- [S368] Must use a dict comprehension instead of a dict constructor with a
|
||||
sequence of key-value pairs. For more information, please refer to
|
||||
http://legacy.python.org/dev/peps/pep-0274/
|
||||
|
||||
Reference in New Issue
Block a user