methnames_of_instance_as_dict(inst)
It is possible for an attribute to be present in the results of dir(inst), but for getattr(inst, attr_name) to raise an Attribute error, that should be handled gracefully.
>>> class BadAttr(object): ... def error(self): ... raise AttributeError ... error = property(error)
>>> inst = BadAttr()
>>> error
in dir(inst)
True
>>> inst.error
Traceback (most recent call last):
...
AttributeError
>>> result = methnames_of_instance_as_dict(inst) # no exception