def __init__(self, mode='both', chars=None):
        """
        Initialize filter
        Accepts a number of modifiers to specify strip mode (left, right, both)
        and possible optional characters to strip. By default strips
        whitespaces and tabs from both sides.

        :param mode:                string, strip mode
        :param chars:               string or None, characters to strip
        :return:                    None
        """
        modes = ['left', 'right', 'both']
        if mode not in modes:
            raise InvalidOption('Allowed strip modes are left, right or both')

        self.mode = mode
        self.chars = None
        if chars:
            self.chars = str(chars)
def __init__ ( self , mode = 'both' , chars = None ) : modes = [ 'left' , 'right' , 'both' ] if mode not in modes : raise InvalidOption ( 'Allowed strip modes are left, right or both' ) self . mode = mode self . chars = None if chars : self . chars = str ( chars )
Initialize filter
        Accepts a number of modifiers to specify strip mode (left, right, both)
        and possible optional characters to strip. By default strips
        whitespaces and tabs from both sides.

        :param mode:                string, strip mode
        :param chars:               string or None, characters to strip
        :return:                    None