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

consider Sequence[Any] instead of Iterable[Any] for ChoiceFields choices #454

Open
asottile-sentry opened this issue Jul 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@asottile-sentry
Copy link
Contributor

this isn't a bug but perhaps a suggestion.

when rest_framework's ChoiceField and MultipleChoiceField receive an unordered collection for choices it can lead to a negative experience: unordered form output, unordered schema, etc.

we've made a small plugin for sentry that enforces this for our uses since we kept hitting this problem: getsentry/sentry#53707

though this isn't entirely in spirit of the type system so understandable if this isn't a good idea

@asottile-sentry asottile-sentry added the bug Something isn't working label Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant