def _cmp()

in libmozdata/buildhub.py [0:0]


    def _cmp(self, other):
        if isinstance(other, str):
            other = VeryLooseVersion(other)

        try:
            if self.version == other.version:
                return 0
            if self.version < other.version:
                return -1
            if self.version > other.version:
                return 1
        except TypeError:
            # Compare them as strings. Happens, for example, when paring
            # [int, int, int] with [int, str, int]
            if str(self) < str(other):
                return -1
            if str(self) > str(other):
                return 1
            return 0