[Python-ideas] PEP for enum library type?

Guido van Rossum guido at python.org
Tue Feb 12 22:58:49 CET 2013


Definitely they need nice reprs.

On Tue, Feb 12, 2013 at 1:04 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Tue, 12 Feb 2013 12:58:44 -0800
> Eli Bendersky <eliben at gmail.com> wrote:
>
>> On Tue, Feb 12, 2013 at 11:59 AM, Guido van Rossum <guido at python.org> wrote:
>>
>> > After all the defenses I still don't like Tim's proposed syntax. Color me
>> > Barry.
>> >
>>
>> In this case, I see no reason not to use Barry's flufl.enum - it's pretty
>> good and has been around for a while. The main advantage of Tim's
>> implementation syntax (wasn't it Michael Foord who originally proposed it?)
>> is that it lets us do less typing which is great. IOW, sure with flufl.enum
>> I can do this and be reasonably happy:
>>
>> class Color(Enum):
>>   RED = 1
>>   BLUE = 2
>>   GREEN = 3
>
> I still hope enum values are strings by default - or, if not, that they
> get nice reprs. Integer enums are only useful for interoperability with
> stubborn low-level libraries :-)
>
> Regards
>
> Antoine.
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas



--
--Guido van Rossum (python.org/~guido)



More information about the Python-ideas mailing list