def locattr(accessing_obj, accessed_obj, *args, **kwargs):
 if hasattr(accessing_obj, 'obj'):
  accessing_obj = accessing_obj.obj
 if hasattr(accessing_obj, 'location'):
  return attr(accessing_obj.location, accessed_obj, *args, **kwargs)

def locattr ( accessing_obj , accessed_obj , * args , ** kwargs ) : if hasattr ( accessing_obj , 'obj' ) : accessing_obj = accessing_obj . obj if hasattr ( accessing_obj , 'location' ) : return attr ( accessing_obj . location , accessed_obj , * args , ** kwargs )
usage: locattr locattr locattr works like attr .