In Perl, I can do this:
push(@{$h->[x]}, y);
Can I simplify the following python codes according to above Perl example?
if x not in h:
h[x] = []
h[x].append(y)
I want to simplify this, because it goes many places in my code, (and I cannot initialize all possible x with []). I do not want to make it a function, because there is no 'inline' keyword.
Any ideas?