On 13 February 2013 08:59, Guido van Rossum <guido@python.org> wrote:
And I'm of the opinion that the most fundamental property of an enum
is that it doesn't print as an int.

That part is easy.

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from enum import Enum
>>> class Color(Enum):
...     RED
...
>>> str(Color.RED)
'Color.RED'
>>> repr(Color.RED)
"<EnumValue 'Color.RED': 0>"
>>> str(Color)
'{RED:0}'
>>> repr(Color)
"<enum __main__.Color {<EnumValue 'RED': 0>}>"

Making an appropriate str/repr just requires deciding what it should be. I chose to make the reprs give more information, but there's no reason they couldn't be simplified.

I'll see if I can come up with a syntax for declaration that we're both happy with, but I doubt I'll be as happy with it as what I've currently got (despite its edge cases).

Tim Delaney