Message217715
> But no, nothing in the python Enum implementation restricts it to a value *range*. It is really a collection of named constants.
I didn't say in the implementation, I said in spirit.
Would you describe all possible Unix PIDs are a Enum?
Also, the problem is that many such constant can have identical values
(because they can be passed at different syscalls/argument offset),
and in this case the IntEnum equality isn't wanted:
cf@neobox:~/python/hg/default$ cat /tmp/test.py
from enum import IntEnum
class Const(IntEnum):
AF_INET = 1
SO_REUSEADDR = 1
print(Const.AF_INET == Const.SO_REUSEADDR)
cf@neobox:~/python/hg/default$ ./python /tmp/test.py
True
Really? |
|
Date |
User |
Action |
Args |
2014-05-01 19:42:06 | neologix | set | recipients:
+ neologix, barry, pitrou, r.david.murray, eli.bendersky, ethan.furman |
2014-05-01 19:42:06 | neologix | link | issue21406 messages |
2014-05-01 19:42:06 | neologix | create | |
|