def dotted_getattr(obj, name):
 return reduce(getattr, name.split('.'), obj)

def dotted_getattr ( obj , name ) : return reduce ( getattr , name . split ( '.' ) , obj )
getattr like function accepting a dotted name for attribute lookup .