On 04/25/2013 06:03 AM, Eli Bendersky wrote:

The __call__ syntax has been repurposed for the convenience API:

--> Animals = Enum('Animals', 'ant bee cat dog')
--> Animals
<Animals {ant: 1, bee: 2, cat: 3, dog: 4}>
--> Animals.ant
<EnumValue: Animals.ant [value=1]>
--> Animals.ant.value
1

The aforementioned deprecated syntax refers to __call__ with a single arguments 
(the convenience API by definition
requires more than one).

I don't understand why having Enum() be the convenience function rules out 
`Animals(1)` from returning `Animals.ant`.

--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to