Did you mean `mro = ([key] if isinstance(key, type) else []) + list(key.__class__.__mro__)`?