def __init__(self, string):
elements = tuple(map(int, string.split("<STR_LIT:.>")))<EOL>if len(elements) == <NUM_LIT:3>:<EOL><INDENT>self.major, self.minor, self.patch = elements<EOL><DEDENT>else:<EOL><INDENT>(self.major, self.minor), self.patch = elements, <NUM_LIT:0><EOL><DEDENT>self.version = (self.major, self.minor, self.patch)<EOL>
:param string: semantic version string (major.minor.patch)