MCPcopy Create free account
hub / github.com/cdgriffith/Box / _get_property_func

Function _get_property_func

box/box.py:141–154  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

139
140
141def _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
157class Box(dict):

Callers 2

__setattr__Method · 0.85
__delattr__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected