示例#1
0
 def __sub__(self, other):
     if isinstance(other, timedelta):
         return self.__class__(days=self.days - timedelta_to_days(other))
     if isinstance(other, PJDay):
         return timedelta(days=self.days - other.days)
示例#2
0
 def __sub__(self, other):
     if isinstance(other, timedelta):
         return self.__class__(days=self.days - timedelta_to_days(other))            
     if isinstance(other, PJDay):
         return timedelta(days=self.days - other.days)
示例#3
0
 def __add__(self, other):
     if not isinstance(other, timedelta):
         raise TypeError(
             "unsupported operand type(s) for +: '%s' and '%s'" %
             (self.__class__, other.__class__))
     return self.__class__(days=self.days + timedelta_to_days(other))
示例#4
0
 def __add__(self, other):
     if not isinstance(other, timedelta):
         raise TypeError("unsupported operand type(s) for +: '%s' and '%s'" % (self.__class__, other.__class__))
     return self.__class__(days=self.days + timedelta_to_days(other))