code: def dist(self, x1, x2):
          
          if x1 not in self:
              raise LinearSpaceTypeError('`x1` {!r} is not an element of '
                                         '{!r}'.format(x1, self))
          if x2 not in self:
              raise LinearSpaceTypeError('`x2` {!r} is not an element of '
                                         '{!r}'.format(x2, self))
          return float(self._dist(x1, x2))
docs: Return the distance between ``x1`` and ``x2``.
  
          Parameters
          ----------
          x1, x2 : `LinearSpaceElement`
              Elements whose distance to compute.
  
          Returns
          -------
          dist : float
              Distance between ``x1`` and ``x2``.