[Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Mon Feb 25 17:56:40 CET 2013
- Previous message: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as
- Next message: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le Mon, 25 Feb 2013 10:44:33 -0600, Skip Montanaro <skip at pobox.com> a écrit :
> Besides "we just don't need them int-based in these use-cases" what > are the reasons for the strong desire to have them be valueless?
Not sure about other people, but piggybacking off C semantics, while convenient, reflects the limitations of the C implementation more than anything else. An enumeration, while you can count its items, doesn't imply that the elements of the enumeration are naturally ordered. If you force an underlying association with integers, you imply ordering where none naturally exists. Given this: critters = enum(DOG, CAT, RACCOON) what does it mean that DOG < CAT?
It doesn't mean anything, but so what? "DOG" > "CAT" doesn't mean much either, and yet it's legal in Python.
Regards
Antoine.
- Previous message: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as
- Next message: [Python-Dev] [Python-checkins] peps: Pre-alpha draft for PEP 435 (enum). The name is not important at the moment, as
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]