Skip to main content

parse_mypy_version

Parse mypy string version to a 3-tuple of ints.

It parses normal version like 1.11.0 and extra info followed by a + sign like 1.11.0+dev.d6d9d8cd4f27c52edac1f537e236ec48a01e54cb.dirty.

def parse_mypy_version(
version: str
) - > tuple[int, int, int]

Parse mypy string version to a 3-tuple of ints. It parses normal version like 1.11.0 and extra info followed by a + sign like 1.11.0+dev.d6d9d8cd4f27c52edac1f537e236ec48a01e54cb.dirty.

Parameters

NameTypeDescription
versionstrThe mypy version string to be parsed, which may include metadata suffixes starting with a plus sign.

Returns

TypeDescription
tuple[int, int, int]A triple of ints representing the major, minor, and patch version components, e.g. (1, 11, 0).