Barry A. Warsaw added the comment:
On May 13, 2013, at 02:06 PM, Antoine Pitrou wrote:
>Antoine Pitrou added the comment:
>
>> >I agree with Nick here, there's no reason to auto-number constants
>> >in
>> >Python. This is not C :-)
>>
>> Why should they be strings? Why not object()?
>
>Because strings are readable, I'd say.
The repr would then be
<Color.red: Color.red>
Yuck.
Also, you would have to allow for subclasses (e.g. IntEnum) to override
auto-assignment. Clearly, you can't use strings for
X = IntEnum('X', 'start middle end')
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue17961>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com