Generate st.fixed_dictionaries()
with varied iteration orders
#3906
Labels
enhancement
it's not broken, but we want it to be better
Currently we generate
st.fixed_dictionaries()
with all the required keys in order, and then a subset of the optional keys after. This was of course fine back when dict iteration order was arbitrary anyway, but it's been insertion-order since Python 3.7 and so we should consider ways to give more varied iteration orders. Thanks to Anne for prompting this issue.Although if the mapping is an
OrderedDict
, maybe you want the unvarying iteration order? We might want to addvary_order: bool=True
kwarg to control this, inelegant though it seems.No strong opinions on how we should implement this yet, just that we should think carefully about how whatever-we-do affects the distribution of lengths we generate and thus the ratio of required keys to optional.
The text was updated successfully, but these errors were encountered: