Python: Add test of safe methods for py/modification-of-default-value

This commit is contained in:
Rasmus Wriedt Larsen
2020-05-05 11:14:37 +02:00
parent 4da5222255
commit 5d5d412b78

View File

@@ -193,3 +193,8 @@ def list_default(x=[1,2,3,4]):
def tuple_default(x=(1,2)):
do_stuff_based_on_type(x)
# Modification of parameter with default (safe method)
def safe_method(x=[]):
return x.count(42)