def _name(obj): if hasattr(obj, '__name__'): return obj.__name__ elif inspect.isdatadescriptor(obj): return obj.fget.__name__