Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate st.fixed_dictionaries() with varied iteration orders #3906

Open
Zac-HD opened this issue Mar 2, 2024 · 0 comments
Open

Generate st.fixed_dictionaries() with varied iteration orders #3906

Zac-HD opened this issue Mar 2, 2024 · 0 comments
Labels
enhancement it's not broken, but we want it to be better

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Mar 2, 2024

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 add vary_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.

@Zac-HD Zac-HD added the enhancement it's not broken, but we want it to be better label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement it's not broken, but we want it to be better
Projects
None yet
Development

No branches or pull requests

1 participant