def setDriftLength(self, x):
        """ set lengths for drift sections

        :param x: single double or list
        :return: None

        :Example:

        >>> import beamline
        >>> chi = beamline.mathutils.Chicane(bend_length=1,bend_field=0.5,drift_length=1,gamma=1000)
        >>> chi.getMatrix()
        >>> r56 = chi.getR(5,6)  # r56 = -0.432
        >>> chi.setDriftLength([2,4,2])
        >>> # same effect (to R56) as ``chi.setDriftLength([2,4])`` or ``chi.setDriftLength([2])``
        >>> # or ``chi.setDriftLength(2)``
        >>> r56 = chi.getR(5,6)  # r56 = -0.620
        """
        if x != self.getDriftLength():
            self._setDriftList(x)
            self.refresh = True
set lengths for drift sections

        :param x: single double or list
        :return: None

        :Example:

        >>> import beamline
        >>> chi = beamline.mathutils.Chicane(bend_length=1,bend_field=0.5,drift_length=1,gamma=1000)
        >>> chi.getMatrix()
        >>> r56 = chi.getR(5,6)  # r56 = -0.432
        >>> chi.setDriftLength([2,4,2])
        >>> # same effect (to R56) as ``chi.setDriftLength([2,4])`` or ``chi.setDriftLength([2])``
        >>> # or ``chi.setDriftLength(2)``
        >>> r56 = chi.getR(5,6)  # r56 = -0.620