On Thu, 24 Jun 2021, 12:58 pm Ethan Furman, firstname.lastname@example.org wrote:
TL;DR I am considering changing IntEnum and IntFlag's `__str__` to be `int.__str__`
IntEnum and IntFlag are becoming more common in the stdlib. They currently show up in
to name just a few.
3.10 already has some changes to the str() and repr() of enums in general:
HTTPStatus -> OK and HTTPStatus.OK instead of HTTPStatus.OK and <HTTPStatus.OK: 200>
That's already a major loss in enum repr() usability - the whole point of having both forms in the output was so that repr() gave you both the symbolic name and the raw number, allowing them to be looked up in external systems without needing access to the original enum definition to translate between forms.
For the other proposal, I think you're stuck from a backwards compatibility point of view - the default needs to be the current behaviour, with some way to opt out of using the symbolic str representation.