Use setdefault instead of a conditional