예제 #1
0
 def __init__(self, itemType, left, right):
     super().__init__(RangeType(itemType))
     # can't just use T extends Comparable<T> because LocalDate and LocalTime extend Comparable<R>
     if left < right:
         self.low = left
         self.high = right
     else:
         self.low = right
         self.high = left
예제 #2
0
 def __init__(self, itemType, left, right):
     from prompto.type.RangeType import RangeType
     super(RangeValue, self).__init__(RangeType(itemType))
     # can't just use T extends Comparable<T> because LocalDate and LocalTime extend Comparable<R>
     cmp_ = self.compare(left, right)
     if cmp_ < 0:
         self.low = left
         self.high = right
     else:
         self.low = right
         self.high = left
예제 #3
0
 def checkRange(self, context, other):
     if isinstance(other, CharacterType):
         from prompto.type.RangeType import RangeType
         return RangeType(self)
     return super(CharacterType, self).checkRange(context, other)
예제 #4
0
 def checkRange(self, context, other):
     if isinstance(other, DateType):
         return RangeType(self)
     else:
         return super(DateType, self).checkRange(context, other)
예제 #5
0
 def checkRange(self, context, other):
     if isinstance(other, IntegerType):
         return RangeType(self)
     return super().checkRange(context, other)