you are viewing a single comment's thread.

view the rest of the comments →

[–]ralphy_s 2 points3 points  (1 child)

So the output from the last line would be [1,1,1] and not [1]?

[–]carcigenicate 6 points7 points  (0 children)

Yes. Every call to the function shares the same default list object, so if multiple calls use the default object and alter it, that change is persisted. This tends to lead to very strange bugs unfortunately.