17 ms·
That's a different issue around default arguments that are mutable, rather than default arguments generally. The lambda case here is more like a default argume
by sjagoe 7y ago
That's a different issue around default arguments that are mutable, rather than default arguments generally.
The lambda case here is more like a default argument of a constant integer (immutable) than a default that is a list, which can be altered directly by the function it's a default of.
- Izkata 7y agoThe underlying feature that both rely on is that default arguments are set on function declaration instead of function call. Mutable/immutable only affects whether or not you hit the bug.