Got bitten by this so many times
RT @OliverCaldwell@twitter.com
I'm no Python expert, but is this a super common bug? How do people use defaults without this happening?
def x (y=[]):
return y
x() => []
x().append(10)
x() => [10]
🐦🔗: https://twitter.com/OliverCaldwell/status/1504472687426498562
literally watch me write:
def x(y=lambda: []):
return y