def atMost(val): """ Makes range including all values less than or equal to some value (i.e. (-inf, val]) Parameters ---------- val : comparable The upper bound Raises ------ ValueError If type not comparable Returns ------- A Range object (-inf, val] """ Range._validate_cutpoints(val) theType = Range._get_type(val) return Range(Cut.belowAll(theType=theType), Cut.aboveValue(val, theType=theType))
def range_all(theType): """Create a range than contains every value of the given type.""" return Range( Cut.belowAll(theType=theType), Cut.aboveAll(theType=theType))
def range_all(theType: Any) -> Range: """Create a range than contains every value of the given type.""" return Range(Cut.belowAll(theType=theType), Cut.aboveAll(theType=theType))
def test_belowAll(self): if debug: print("Testing belowAll") theCut = Cut.belowAll(int) self.assertTrue(theCut.belowAll) self.assertFalse(theCut.aboveAll) self.assertIsNone(theCut.point)