Make getattr more simpler

Actually, ```q = getattr(obj, '__qualname__', obj.__name__)``` looks more efficient.