[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Aaron Koch
Aaron Koch added the comment: Are there any other names that you would contemplate besides `from_name` and `from_value`? My reading of your response indicates that you are fundamentally opposed to the addition of class methods, since they would limit the space of possible instance methods

[issue45473] Enum add "from_name" and "from_value" class methods

2021-10-14 Thread Aaron Koch
New submission from Aaron Koch : Documentation: https://docs.python.org/3/library/enum.html#creating-an-enum Current behavior: SomeEnum[name] is used to construct an enum by name SomeEnum(value) is used to construct an enum by value Problem: As a user of enums, it is difficult to remember