-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
felis.predicate.interval
and felis.predicate.float.portion
, f…
…ormat `__all__`s
- Loading branch information
Showing
6 changed files
with
35 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from felis.currying import curry | ||
from felis.predicate import Predicate, both, comparison | ||
from felis.typing import SupportsRichComparison | ||
|
||
__all__ = ["inclusive", "inclusive_exclusive", "exclusive_inclusive", "exclusive"] | ||
|
||
|
||
@curry | ||
def inclusive[T: SupportsRichComparison](maximum: T, minimum: T) -> Predicate[T]: | ||
return both(comparison.greater_or_equal(minimum))(comparison.less_or_equal(maximum)) | ||
|
||
|
||
@curry | ||
def inclusive_exclusive[T: SupportsRichComparison](maximum: T, minimum: T) -> Predicate[T]: | ||
return both(comparison.greater_or_equal(minimum))(comparison.less(maximum)) | ||
|
||
|
||
@curry | ||
def exclusive_inclusive[T: SupportsRichComparison](maximum: T, minimum: T) -> Predicate[T]: | ||
return both(comparison.greater(minimum))(comparison.less_or_equal(maximum)) | ||
|
||
|
||
@curry | ||
def exclusive[T: SupportsRichComparison](maximum: T, minimum: T) -> Predicate[T]: | ||
return both(comparison.greater(minimum))(comparison.less(maximum)) |