[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library

MRAB python at mrabarnett.plus.com
Fri Apr 26 03:03:24 CEST 2013

On 26/04/2013 00:59, Glenn Linderman wrote:
> On 4/25/2013 3:23 PM, Barry Warsaw wrote:
>> My point is, "days of the week" has a natural ordering, so why wouldn't you
>> use IntEnum for that?  Problem solved.
> While the ordering is natural, some implementations start from 0, some
> start from 1, and on the naming side, some start from Sunday, and some
> start from Monday. So there are lots of opportunities for the numbers
> vary, and having easy conversions to int which expose those numbers and
> allow comparisons to integers, is adding problems, not solving them.
But there _is_ an ordering problem, in that the days wrap around.

More information about the Python-Dev mailing list