-
-
Notifications
You must be signed in to change notification settings - Fork 495
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersstubsIssues in stubs files (.pyi)Issues in stubs files (.pyi)
Description
Bug report
What's wrong
When using an enum created from the functional enum API, mypy complains that the enum doesn't have an attribute choices
, however it does.
How is that should be
choices
should be a supported attribute when the enum is instantiated.
System information
- OS:
python
version: 3.10.12django
version: 4.2.8mypy
version: 1.7.1django-stubs
version: 4.2.7django-stubs-ext
version: 4.2.7
Repro
from django.db.models import TextChoices
print(TextChoices("test", "A B C").choices)
repro.py:3:1: error: "TextChoices" has no attribute "choices" [attr-defined]
If you run the script you see the choices are printed correctly:
$ python repro.py
[('A', 'A'), ('B', 'B'), ('C', 'C')]
intgr and ulgens
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersstubsIssues in stubs files (.pyi)Issues in stubs files (.pyi)