[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

Guido van Rossum guido at python.org
Sat Apr 13 02:58:25 CEST 2013


Well, even better. :-)

On Fri, Apr 12, 2013 at 5:13 PM, Glenn Linderman <v+python at g.nevcal.com> wrote:
> On 4/12/2013 3:59 PM, Guido van Rossum wrote:
>
> class Insect(Enum):
>     wasp = 1
>     bee = 1
>     ant = 2
>
> We'd have Insect.wasp == Insect.bee < Insect.ant but Insect.wasp is
> not Insect.bee.
>
>
> can't define two names in the same enum to have the same value, per the PEP.
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/guido%40python.org
>



-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-Dev mailing list