code: def extend(s, var, val):
      
      s2 = s.copy()
      s2[var] = val
      return s2
docs: Copy the substitution s and extend it by setting var to val;
      return copy.
      >>> ppsubst(extend({x: 1}, y, 2))
      {x: 1, y: 2}