sbdchd / django-types

:doughnut: Type stubs for Django
MIT License
186 stars 62 forks source link

Class property `Choices.values` returns list of Members #232

Closed geigerzaehler closed 5 months ago

geigerzaehler commented 5 months ago

For any subclass E of Choices, IntegerChoices or TextChoices E.values now has type Sequence[E] instead of list[str] (or list[int]). Similarly for E.choices. The implementation is borrowed from the typeshed implementation of enum.EnumMeta.

I’m not sure about the tests, i.e. just putting a subclass of Choices into the models module. Happy to change that.