-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Currently, it is not possible to compose refinement predicates; for example:
from refined.predicates import NonEmpty, Contains
from typing import Annotated, Literal, List
NonEmptyListWithAZero = Annotated[List[int], NonEmpty[List[int]], Contains[List[Int], Literal[0]]]However, you can define nested annotated types, which would return a composed annotated type with refinement predicates:
from refined.predicates import NonEmpty, Contains
from typing import Annotated, Literal, List
NonEmptyList = Annotated[List[int], NonEmpty[List[int]]]
ListWithAZero = Annotated[NonEmptyList, Contains[List[Int], Literal[0]]]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels