3 ms·
> What may surprise people is how and when these expressions are evaluated since they differ between languages. What could possibly be surprising about reusing
by josefx 4y ago
> What may surprise people is how and when these expressions are evaluated since they differ between languages.
What could possibly be surprising about reusing the exact same object on every function call, especially when you default to an empty list, set or dict. Getting an actual empty list is as easy as defaulting to None and explicitly checking for it, so there isn't even a reason to do it any differently. /s
Who the hell thought that this was sane behavior in a language with mostly mutable objects?