'Setter for mode to do basic type checking.'

@mode.setter
def mode(self, val):

    if (not isinstance(val, PromptMode)):
        raise TypeError('Mode    {}    is    no    PromptMode    member!'.format(val))
    self._mode = val
