Skip to content

Commit 5d5d412

Browse files
committed
Python: Add test of safe methods for py/modification-of-default-value
1 parent 4da5222 commit 5d5d412

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

python/ql/test/query-tests/Functions/general/functions_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,8 @@ def list_default(x=[1,2,3,4]):
193193

194194
def tuple_default(x=(1,2)):
195195
do_stuff_based_on_type(x)
196+
197+
# Modification of parameter with default (safe method)
198+
199+
def safe_method(x=[]):
200+
return x.count(42)

0 commit comments

Comments
 (0)