I opened my python interpreter, coded up and ran the following function.
>>> def crazy_function(my_list=[]):
... my_list.append(0)
... return my_list
...
>>> crazy_function()
[0]
>>> crazy_function()
[0, 0]
>>> crazy_function()
[0, 0, 0]
>>> crazy_function()
[0, 0, 0, 0]
>>> crazy_function()
[0, 0, 0, 0, 0]
>>> crazy_function()
[0, 0, 0, 0, 0, 0]
>>> crazy_function()
[0, 0, 0, 0, 0, 0, 0]
>>>
What is going on? Why does the list returned by the function keep getting longer the more I call the function? Shouldn't a new local list be created every time the function is called?