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

Function _get_property_func

box/box.py:276–287  ·  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

274
275
276def _get_property_func(obj, key):
277 """
278 Try to get property helper functions of given object and property name.
279
280 :param obj: object to be checked for property
281 :param key: property name
282 :return: a tuple for helper functions(fget, fset, fdel). If no such property, a (None, None, None) returns
283 """
284 attr = getattr(type(obj), key, None)
285 if not isinstance(attr, property):
286 return None, None, None
287 return attr.fget, attr.fset, attr.fdel
288
289
290class Box(dict):

Callers 2

__setattr__Method · 0.85
__delattr__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected