Message189142
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') |
|
Date |
User |
Action |
Args |
2013-05-13 15:09:31 | barry | set | recipients:
+ barry, ncoghlan, pitrou, ethan.furman |
2013-05-13 15:09:31 | barry | link | issue17961 messages |
2013-05-13 15:09:31 | barry | create | |
|