Message381220
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? |
|
Date |
User |
Action |
Args |
2020-11-17 09:01:11 | Antony.Lee | set | recipients:
+ Antony.Lee |
2020-11-17 09:01:11 | Antony.Lee | set | messageid: <1605603671.61.0.469483986721.issue42385@roundup.psfhosted.org> |
2020-11-17 09:01:11 | Antony.Lee | link | issue42385 messages |
2020-11-17 09:01:11 | Antony.Lee | create | |
|