This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Antony.Lee
Recipients Antony.Lee
Date 2020-11-17.09:01:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605603671.61.0.469483986721.issue42385@roundup.psfhosted.org>
In-reply-to
Content
Currently, enum.auto doesn't work with the new (Py3.10) StrEnum: `class E(enum.StrEnum): a = enum.auto()` results in `TypeError: 1 is not a string`.

I would guess that the most reasonable behavior for auto() in a StrEnum would be to return the name itself, as implemented in the AutoName example at https://docs.python.org/3.10/library/enum.html#using-automatic-values.  I believe that this may just be a matter of copying the corresponding `_generate_next_value_` implementation into the definition of StrEnum?
History
Date User Action Args
2020-11-17 09:01:11Antony.Leesetrecipients: + Antony.Lee
2020-11-17 09:01:11Antony.Leesetmessageid: <1605603671.61.0.469483986721.issue42385@roundup.psfhosted.org>
2020-11-17 09:01:11Antony.Leelinkissue42385 messages
2020-11-17 09:01:11Antony.Leecreate