On 14 February 2013 05:14, Barry Warsaw
On Feb 12, 2013, at 02:13 PM, Eli Bendersky wrote:
I agree, and Tim's implementation provides a very nice string representation, no matter what the value underneath is. I don't really care what the value underneath is, actually.
Except that sometimes you do, which is why flufl.enum has a nice concise str and a more detailed repr. The former doesn't include the underlying value while the latter does. Edible cake.
Yes - my enum's exactly the same - simple, concise str (for both the enum
and values) and detailed repr. The actual repr is a little different to
flufl.enum repr (I think the str is the same) but conveys the same
information.
Color.RED