I think it's more conventional to write `if k2 in d[k]`