-
Notifications
You must be signed in to change notification settings - Fork 27
Description
I am trying to use annotated types to encourage hypothesis to automatically generate objects, running into trouble, and realising that I'm really unsure what the intended way to use annotated-types is. Concretely, I have written:
FiniteFloat = Annotated[float, IsFinite]Is this correct and idiomatic? How should multiple annotations be handled? Is the following acceptable?
PositiveFloat = Annotated[FiniteFloat, Gt(0)]I don't think annotated types are allowed to be nested like this, or at least hypothesis seems to choke on them, so what is the idiomatic way to compose constraints?
There is also some code demonstrating how to create GroupedMetadata but no code indicating how it should be used, or what for.
I looked into the test suite, but (perhaps understandably) it doesn't really have any idiomatic simple examples I can draw from.