Source

talks / python-gotchas / src / defarg.py

Full commit
1
2
3
4
5
6
7
8
def append_print(i, items=[]):
    items.append(i)
    print(items)

append_print(1)
# => [1]
append_print(2)
# => [1, 2]