On Apr 29, 2013, at 7:32 AM, Ethan Furman wrote:
> On 04/28/2013 01:02 PM, Guido van Rossum wrote:
>> On Sun, Apr 28, 2013 at 12:32 PM, Ethan Furman wrote:
>> - should enum items be of the type of the Enum class? (i.e. type(SPRING)
>> is Seasons)
>
> IMO Yes.

This decision seems natural to me, so I wrote an enumeration library
some time ago that uses a simple metaclass to achieve
"type(Season.spring) is Season":

https://github.com/sampsyo/beets/blob/master/beets/util/enumeration.py

The module has other warts but perhaps it can be helpful anyway.

Cheers,

Adrian

_______________________________________________
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