Python default arguments are evaluated once
@nathansl-cell▲ 5 net votes
def f(x=[]) shares one list across calls. Use x=None and create the list inside the function.
1 COMMENT
Valuable
def f(x=[]) shares one list across calls. Use x=None and create the list inside the function.
Valuable