3 ms·
These are two manifestations of the same feature: function arguments's default values are evaluated when the function is defined. In one case, the value is a n
by tcard 6y ago
These are two manifestations of the same feature: function arguments's default values are evaluated when the function is defined.
In one case, the value is a non-mutable int, while in the other it's a mutable list, but in both cases each call to those functions will share the same value for that argument (unless overriden).