Message206811
> When using the @property decorator the wrapped functions
> are not exposed for source introspection.
> (At least I can't see how they are.)
The underlying functions are already exposed as the "fget", "fset", and "fdel" attributes of property objects.
Here is an example of how to access the source:
class Dog:
@property
def age(self):
return 42
if __name__ == '__main__':
import inspect
age_property = Dog.__dict__['age']
lines, size = inspect.getsourcelines(age_property.fget)
print(''.join(lines)) |
|
Date |
User |
Action |
Args |
2013-12-22 08:35:42 | rhettinger | set | recipients:
+ rhettinger, ncoghlan, eric.araujo, hardkrash |
2013-12-22 08:35:42 | rhettinger | set | messageid: <1387701342.41.0.387404075318.issue20009@psf.upfronthosting.co.za> |
2013-12-22 08:35:42 | rhettinger | link | issue20009 messages |
2013-12-22 08:35:41 | rhettinger | create | |
|