[issue39234] `enum.auto()` incrementation value not specified.

YoSTEALTH report at bugs.python.org
Mon Jan 6 14:10:39 EST 2020


New submission from YoSTEALTH <ritesh at stealthcentral.com>:

# 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.

----------
assignee: docs at python
components: Documentation
messages: 359452
nosy: YoSTEALTH, docs at python
priority: normal
severity: normal
status: open
title: `enum.auto()` incrementation value not specified.
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39234>
_______________________________________


More information about the Python-bugs-list mailing list