That's a problem with any attempt to find an enum member by value, since values aren't guaranteed to be unique. With either proposal, we'd just need to pick one - probably the one that appears first in the class dict.
On Tue, Mar 16, 2021, 2:39 PM Marco Sulla Marco.Sulla.Python@gmail.com wrote:
On Tue, 16 Mar 2021 at 05:38, Matt Wozniski email@example.com wrote:
Color.from_value(1) # returns Color.RED
What if I have an alias? _______________________________________________ Python-ideas mailing list -- firstname.lastname@example.org To unsubscribe send an email to email@example.com https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://firstname.lastname@example.org/message/NQ535P... Code of Conduct: http://python.org/psf/codeofconduct/