We can shorten this with a 3-arg getattr(obj, attr, fallback).