On Apr 28, 2013, at 07:46 PM, Ethan Furman wrote: >and similarly, Enum behavior /should be/ (in my opinion ;) > >Season.AUTUMN is Season('AUTUMN') is Season(3)
I think you'll have a problem with this. flufl.enum did this, but it has an inherent conflict, which is why we removed the getattr-like behavior. class Things(Enum): foo = 'bar' bar = 'foo' What does Things('foo') return? Note that it doesn't matter if that's spelled Things['foo']. Whether it's defined as lookup or instance "creation", you should only map values to items, and not attribute names to items, and definitely not both. Let getattr() do attribute name lookup just like normal. -Barry _______________________________________________ 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