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 <[email protected]>
wrote:

> On Tue, 16 Mar 2021 at 05:38, Matt Wozniski <[email protected]> wrote:
> > Color.from_value(1)  # returns Color.RED
>
> What if I have an alias?
> _______________________________________________
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/NQ535PUFCWRBBN5QVTGB7QOBNJNJJEPO/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/B7PEYLOVWD7KOI4SUUXLU224N6XAJ2JR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to