Suppose I have a class MyClass that has a property created with the @property decorator, like this:
class MyClass(object):
@property
def foo(self):
if whatever:
return True
else:
return False
Suppose I want to use the python inspect module to get the source code that defines the property. I know how to do this for methods (inspect.getsource) but I don't know how to do this for property objects. Anyone know how to do this?