def __cmp__(self, other):
        """ compare BusinessPeriods, comparison by (years*12+months)*31+days

        :param BusinessPeriod other:
        :return: int
        """
        assert type(self) == type(other), "types don't match %s" % str((type(self), type(other)))
        s = (self.years * 12 + self.months) * 31 + self.days
        o = (other.years * 12 + other.months) * 31 + other.days
        return s - o
def __cmp__ ( self , other ) : assert type ( self ) == type ( other ) , "types don't match %s" % str ( ( type ( self ) , type ( other ) ) ) s = ( self . years * 12 + self . months ) * 31 + self . days o = ( other . years * 12 + other . months ) * 31 + other . days return s - o
compare BusinessPeriods, comparison by (years*12+months)*31+days

        :param BusinessPeriod other:
        :return: int