code: def rec_setattr(obj, attr, value):
      
      attrs = attr.split('.')
      setattr(reduce(getattr, attrs[:-1], obj), attrs[-1], value)
docs: Set object's attribute. May use dot notation.
  
      >>> class C(object): pass
      >>> a = C()
      >>> a.b = C()
      >>> a.b.c = 4
      >>> rec_setattr(a, 'b.c', 2)
      >>> a.b.c
      2