This function receives a dict as a keyword argument. It then prints this dict, and updates it >after<.
When I run it the first time, without passing arguments, the dict is, obviously, empty. But when I run the same function again, also without passing arguments, the dict is not empty, and has the data that was stored in the first call.
Shouldn't these two objects be independent? If not, how can I make them such, without passing arguments and without copying the object inside the function?
(this is necessary for my usecase, since I want to share a memory recursively, but not between different starting points, and, unfortunately, the function call won't pass this argument).
Thanks
def a(b={}):
print(b)
b['c'] = 'd'
a() # {}
a() # {'c': 'd'}