Mutable Default.
In Python, default arguments are evaluated once — when the function is defined. Mutable defaults like [] or {} are therefore shared between calls.
Buggy example:
Correct pattern:
In Python, default arguments are evaluated once — when the function is defined. Mutable defaults like [] or {} are therefore shared between calls.
Buggy example:
Correct pattern: