3 ms·
Yeah, that's more or less what happens. What you'd, admittedly naively, want, though, is a way of saying "a new empty dictionary, please", so you don't wind up
by adw 17y ago
Yeah, that's more or less what happens. What you'd, admittedly naively, want, though, is a way of saying "a new empty dictionary, please", so you don't wind up having to write this kind of thing:
def f(a, d=None):
if d is None:
d = {}
which, okay, it's a minor deal, and I know why it happens, but it's the kind of thing I forget you need to do!