Whhats wrong with 7.?
D.get(key, None)
is just syntax noise (in the best case - in the worst case, it signifies someone who doesn't know/understand Python). D.get(key)
should be used instead, or D.get(key, "whatever")
if required. D.get(key, None)
since I forget that dict.get and getattr() have different behavior in the case of missing keys/attributes...