Message359452
# enum in C
# ---------
enum {
a,
b,
c
}
# a = 0
# b = 1
# b = 2
# enum in Python
# --------------
class Count(enum.IntEnum):
a = enum.auto()
b = enum.auto()
c = enum.auto()
# a = 1
# b = 2
# b = 3
I am not sure why the `enum.auto()` starts with 1 in Python but this has just wasted a week worth of my time. |
|
Date |
User |
Action |
Args |
2020-01-06 19:10:39 | YoSTEALTH | set | recipients:
+ YoSTEALTH, docs@python |
2020-01-06 19:10:39 | YoSTEALTH | set | messageid: <1578337839.24.0.759731756128.issue39234@roundup.psfhosted.org> |
2020-01-06 19:10:39 | YoSTEALTH | link | issue39234 messages |
2020-01-06 19:10:39 | YoSTEALTH | create | |
|