http://bugs.python.org/issue19011

So, as anyone who has worked with Enum is probably aware by now, Enum's are a strange duck -- you might even call them platypuses.

For example, Enum members are instances of the class, but they are defined inside the class structure, and new ones cannot be created afterwards; Enum classes also support iteration and containment checks.

What I'm looking for feedback on is the question is #19011: should an Enum 
member be considered a class level attribute?

On the one hand, they are defined inside the class, and they are accessed via 
dot notation (EnumClass.member).

On the other hand, inside the class they look like 3 and 5 and 'up' and 'east', 
and they don't live in the class dictionary.

Also, if we change Enum so that members do act more like class attributes, then things like Color.red.blue.green.blue will result in Color.blue, and that seems stranger to me than having class instances be available on the class without be full-fledged class-attributes.

Thoughts?  Opinions?  Pearls of wisdom?

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

Reply via email to