def f(arg=[]): if not arg: arg.append(42) print arg f([1, 2, 3]) f() f()