def parse_version(version: str) -> tuple:
if not version:<EOL><INDENT>return None<EOL><DEDENT>parts = version.split('<STR_LIT:.>')<EOL>missing = <NUM_LIT:3> - len(parts)<EOL>return tuple(int(i) for i in parts + ([<NUM_LIT:0>] * missing))<EOL>
Parse a string formatted X[.Y.Z] version number into a tuple

    >>> parse_version('10.2.3')
    (10, 2, 3)

    >>> parse_version('12')
    (12, 0, 0)