Support builds(Optional[MyDataclass]) or document alternative
#2930
Labels
legibility
make errors helpful and Hypothesis grokable
Since
builds(A)works, I was thinking I can just usebuilds(Optional[A]), since ifAis a type,Optional[A]is also a type.But it doesn't work:
It would be nice if it worked, or this use case was documented. I searched in vain for a strategy combinator
optional(s: Strategy[A]) -> Strategy[Optional[A]]or something like that, so that I could dooptional(builds(A))and sometimes get aNone, sometimes get anA.The text was updated successfully, but these errors were encountered: