AlloViz.AlloViz.utils.rgetattr¶
- AlloViz.AlloViz.utils.rgetattr(obj, *attrs)[source]¶
Recursive version of the built-in getattr
It recursively checks if the successive strings passed are attributes of the object or the object’s attribute, or the object’s attribute’s attribute… to finally return the final attribute or else return False.
- Parameters:
- obj
Object in which to check if the first attribute passed exists and retrieve it.
- attrsstr
Strings to recursively use to retrieve attributes.
See also
Examples
>>> import AlloViz >>> rgetattr = AlloViz.AlloViz.utils.rgetattr >>> rgetattr <function AlloViz.AlloViz.utils.rgetattr(obj, *attrs)> >>> rgetattr(AlloViz, "AlloViz", "utils", "rgetattr") <function AlloViz.AlloViz.utils.rgetattr(obj, *attrs)> >>> rgetattr(AlloViz.AlloViz.utils, "rgetattr") <function AlloViz.AlloViz.utils.rgetattr(obj, *attrs)> >>> rgetattr(AlloViz, "AlloViz", "utils", "is_attr") False