def __cmp__(self, other):
        """Called for objects comparison.
        Return a negative integer if self < other,
        zero if self == other,
        a positive integer if self > other.
        """
        if not isinstance(other, VersionInfo):
            other = VersionInfo(other)
        res = 0
        for name in self.__slots__:
            res = getattr(self, name) - getattr(other, name)
            if res != 0:
                break
        return res
Called for objects comparison.
        Return a negative integer if self < other,
        zero if self == other,
        a positive integer if self > other.
        
recipes/Python/521888_Comparing_version_info/recipe-521888.py