[New-bugs-announce] [issue44993] enum.auto() starts with one instead of zero

David Rebbe report at bugs.python.org
Tue Aug 24 10:19:43 EDT 2021


New submission from David Rebbe <ic3man5 at gmail.com>:

enum.auto() By default, the initial value starts at 1. Per the documentation here: https://docs.python.org/3/library/enum.html#enum.auto

This doesn't really follow expected behavior in majority of programming languages nor python. Most will expect starting value to be zero. I personally skipped over this as I've never seen an enum start at 1 in any language before. Excuse my ignorance if this is more common place then I realize.

I propose an optional argument to the class to allow different starting values: enum.auto(0)

----------
messages: 400210
nosy: David Rebbe2
priority: normal
severity: normal
status: open
title: enum.auto() starts with one instead of zero
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list