def my_function(keyword_arg=None): """appends or starts a new list""" if keyword_arg: keyword_arg.append(1) else: keyword_arg = [1] return keyword_arg