-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
With this code:
from django_enum.choices import TextChoices
from enum import auto
class MyTextChoices(TextChoices):
custom_value: str
FOO = auto(), "FOO", "foo123"I get this error
Traceback (most recent call last):
File "bug.py", line 4, in <module>
class MyTextChoices(TextChoices):
...<2 lines>...
FOO = auto(), 'FOO', 'foo123'
File "/home/noam/venv/lib/python3.14/site-packages/django_enum/choices.py", line 37, in __new__
cls = super().__new__(mcs, classname, bases, classdict, **kwargs)
File "/home/noam/venv/lib/python3.14/site-packages/enum_properties/__init__.py", line 662, in __new__
cls = super().__new__(
mcs,
...<3 lines>...
**kwargs,
)
File "/home/noam/venv/lib/python3.14/site-packages/django/db/models/enums.py", line 49, in __new__
cls = super().__new__(metacls, classname, bases, classdict, **kwds)
File "/home/noam/.pyenv/versions/3.14.0/lib/python3.14/enum.py", line 549, in __new__
enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
File "/home/noam/.pyenv/versions/3.14.0/lib/python3.14/enum.py", line 255, in __set_name__
enum_member = enum_class._new_member_(enum_class, *args)
File "/home/noam/.pyenv/versions/3.14.0/lib/python3.14/enum.py", line 1353, in __new__
raise TypeError('%r is not a string' % (values[0], ))
TypeError: auto('FOO') is not a stringI think it may be possible that add_member_and_properties doesn't take into account the label.
bckohan
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working