BadPython.com

Suggestion for "Default argument"

set parameter default to None, and then replace with new list inside function, if needed
            
def my_function(keyword_arg=None):
    keyword_arg = keyword_arg or []
    keyword_arg.append(1)
    return keyword_arg

assert(my_function() == [1])
assert(my_function() == [1]) # False: [1, 1] != [1]