improve motivation and rationale

This commit is contained in:
Ethan Furman 2021-07-20 21:10:30 -07:00
parent f350ee5630
commit f58b89ccd6
1 changed files with 6 additions and 2 deletions

View File

@ -24,8 +24,11 @@ intended purpose.
Motivation
==========
The addition of ``StrEnum`` with its requirement to have its ``str()`` be its
``value`` is inconsistent with other provided Enum's ``str``.
Having the ``str()`` of ``IntEnum`` and ``IntFlag`` not be the value causes
bugs and extra work to get the correct behavior.
bugs and extra work when replacing existing constants.
Having the ``str()`` and ``format()`` of an enum member be different can be
confusing.
@ -63,7 +66,8 @@ updating.
As much as possible, the ``str()`, ``repr()``, and ``format()`` of enum members
should be standardized across the stardard library.
The repr() of Flag is... not elegant, and can be greatly improved.
The repr() of Flag currently includes aliases, which it should not; fixing that
will, of course, already change its ``repr()`` in certain cases.
Specification