def __init__(self, valid_choices=None, message=None):
if message is not None:<EOL><INDENT>self.invalid_choice = message<EOL><DEDENT>try:<EOL><INDENT>iter(valid_choices)<EOL><DEDENT>except TypeError:<EOL><INDENT>raise InvalidOption('<STR_LIT>')<EOL><DEDENT>self.choices = valid_choices<EOL>
Initialize validator
Accepts an iterable of valid choices to check against.

:param min:             int or None, minimum length
:param max:             int or None, maximum length
:param message:         str, custom error message
:return:                None