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]