On Tue, Apr 30, 2013 at 09:19:49PM -0700, Ethan Furman wrote: > Latest code available at https://bitbucket.org/stoneleaf/aenum. > > --> class Color(Enum): > ... red = 1 > ... green = 2 > ... blue = 3
Ethan, you seem to be writing a completely new PEP in opposition to Barry's PEP 435. But your implementation doesn't seem to match what your proto-PEP claims. Your proto-PEP (file enum.txt) says: ``Enum` - a valueless, unordered type. It's related integer value is merely to allow for database storage and selection from the enumerated class. An ``Enum`` will not compare equal with its integer value, but can compare equal to other enums of which it is a subclass. but: py> import aenum py> class Color(aenum.Enum): ... red = 1 ... py> Color.red == 1 True py> type(Color.red) is int True So the implemented behaviour is completely different from the documented behaviour. What gives? Given the vast number of words written about enum values being instances of the enum class, I'm surprised that your proto-PEP doesn't seem to mention one word about that. All it says is that enum values are singletons. (Unless I've missed something.) -- Steven _______________________________________________ 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