def __new__(cls, version):
if isinstance(version, str):<EOL><INDENT>mobj = re.match('<STR_LIT>', version)<EOL>if mobj:<EOL><INDENT>version = [int(i) for i in mobj.groupdict()['<STR_LIT:version>'].split('<STR_LIT:.>')]<EOL>return tuple.__new__(cls, version)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>return tuple.__new__(cls, [int(v) for v in version])<EOL><DEDENT>except:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>
Static method for creating a new instance which is a subclass of 
        immutable tuple type. Versions are parsed and stored as a tuple of 
        integers internally.

        @param cls:     Class
        @param version: Version must either be a string or a tuple of integers
                        or strings representing integers. 

        Version strings must begin with integer numbers separated by dots and 
        may end with any string.