def __init__(self, ver_str='<STR_LIT>', make_token=AlphanumericVersionToken):
self.tokens = []<EOL>self.seps = []<EOL>self._str = None<EOL>self._hash = None<EOL>if ver_str:<EOL><INDENT>toks = re_token.findall(ver_str)<EOL>if not toks:<EOL><INDENT>raise VersionError(ver_str)<EOL><DEDENT>seps = re_token.split(ver_str)<EOL>if seps[<NUM_LIT:0>] or seps[-<NUM_LIT:1>] or max(len(x) for x in seps) > <NUM_LIT:1>:<EOL><INDENT>raise VersionError("<STR_LIT>" % ver_str)<EOL><DEDENT>for tok in toks:<EOL><INDENT>try:<EOL><INDENT>self.tokens.append(make_token(tok))<EOL><DEDENT>except VersionError as e:<EOL><INDENT>raise VersionError("<STR_LIT>"<EOL>% (ver_str, str(e)))<EOL><DEDENT><DEDENT>self.seps = seps[<NUM_LIT:1>:-<NUM_LIT:1>]<EOL><DEDENT>
Create a Version object.

        Args:
            ver_str: Version string.
            make_token: Callable that creates a VersionToken subclass from a
                string.