Skip to content

Version

Version

Defines lexical comparisons similar to a tuple. e.g.: Version(1, 2) is v1.2 and considered higher than Version(1, 1) which is v1.1

Any number of version components may be defined

__eq__

__eq__(other: Version) -> bool

__ge__

__ge__(other: Version) -> bool

__gt__

__gt__(other: Version) -> bool

__le__

__le__(other: Version) -> bool

__lt__

__lt__(other: Version) -> bool

__ne__

__ne__(other: Version) -> bool

__new__

__new__(*nums: int) -> Version

Construct a version instance from the given components, starting with the most significant (major) component

Parameters:

  • *nums (int, default: () ) –

    The component numbers of the version

from_str classmethod

from_str(ver_str: str) -> Version

Construct a version instance from the given version string

Parameters:

  • ver_str (str) –

    A string of the format "x.y.z" (there may be more or lesser than three components) where x, y, and z are numbers

Returns: