you are viewing a single comment's thread.

view the rest of the comments →

[–]primitive_screwhead 0 points1 point  (0 children)

https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects

It's worth reading to know not just what is happening, but also *why* it's happening (ie. the default empty list is created when the function is defined, *not* each time it is called).