import amara def chain_attribute_call(obj, attlist): \"\"\" Allows to execute chain attribute calls \"\"\" splitted_attrs = attlist.split(\".\")
Just copying from Useful code which uses reduce() in Python:
from functools import reduce reduce(getattr, "X.Y.Z".split('.'), doc)