Try to get property helper functions of given object and property name. :param obj: object to be checked for property :param key: property name :return: a tuple for helper functions(fget, fset, fdel). If no such property, a (None, None, None) returns
(obj, key)
| 139 | |
| 140 | |
| 141 | def _get_property_func(obj, key): |
| 142 | """ |
| 143 | Try to get property helper functions of given object and property name. |
| 144 | |
| 145 | :param obj: object to be checked for property |
| 146 | :param key: property name |
| 147 | :return: a tuple for helper functions(fget, fset, fdel). If no such property, a (None, None, None) returns |
| 148 | """ |
| 149 | obj_type = type(obj) |
| 150 | |
| 151 | if not hasattr(obj_type, key): |
| 152 | return None, None, None |
| 153 | attr = getattr(obj_type, key) |
| 154 | return attr.fget, attr.fset, attr.fdel |
| 155 | |
| 156 | |
| 157 | class Box(dict): |
no outgoing calls
no test coverage detected