L
Lie
-0 from me. I'd rather feature it more prominently in the tutorial, a
section "The five most common pitfalls" or something like that.
A check at compilation time for list literals would catch 90 % of the cases.
The warning would be targeted at newbies after all. It might still be a
source of confusion when they try to import someone else's code that uses
mutable defaults intentionally.
-1. I think, as many people before me has said, we should treat
programmers as an adult[1], and doesn't try to babysit them by giving
a warning, or worse as an exception. But I do agree that python should
have something like -Wall, where programmers are warned of all
potential problems.
[1] Anyway, you spent your time being a newbie only for a very short
time.