From bd3c539d8859724d9fa08dbca641ebe94d1c4f32 Mon Sep 17 00:00:00 2001 From: LeeeeT Date: Tue, 11 Jun 2024 08:08:29 -0800 Subject: [PATCH] Add `felis.constrained.float.portion` --- src/felis/constrained/float.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/felis/constrained/float.py b/src/felis/constrained/float.py index 195dbdc..7acf538 100644 --- a/src/felis/constrained/float.py +++ b/src/felis/constrained/float.py @@ -3,7 +3,20 @@ import felis.predicate.float from felis.constrained import smart_constructor -__all__ = ["Negative", "negative", "NonPositive", "non_positive", "NonZero", "non_zero", "NonNegative", "non_negative", "Positive", "positive"] +__all__ = [ + "Negative", + "negative", + "NonPositive", + "non_positive", + "NonZero", + "non_zero", + "NonNegative", + "non_negative", + "Positive", + "positive", + "Portion", + "portion", +] Negative = NewType("Negative", float) @@ -29,3 +42,8 @@ Positive = NewType("Positive", float) positive = smart_constructor(Positive)(felis.predicate.float.positive) + + +Portion = NewType("Portion", float) + +portion = smart_constructor(Portion)(felis.predicate.float.portion)