[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library (original) (raw)
MRAB python at mrabarnett.plus.com
Fri Apr 26 03:03:24 CEST 2013
- Previous message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Next message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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. [snip] But there is an ordering problem, in that the days wrap around.
- Previous message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Next message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]