[New-bugs-announce] [issue21706] Add base for enumerations (Functional API)

Dmitry Korchemny report at bugs.python.org
Tue Jun 10 16:33:48 CEST 2014


New submission from Dmitry Korchemny:

In enum module the functional API for enum creation has the following signature:
Enum(value='NewEnumName', names=<...>, *, module='...', qualname='...', type=<mixed-in class>)

so that the numeration always starts with 1. In some cases it is convenient to start numbering from other base, e.g., 0. It would be of great help to add an additional parameter, say start, to make the following call possible:

Animal = Enum('Animal', 'ant bee cat dog', start = 0)

----------
components: Library (Lib)
messages: 220169
nosy: dkorchem
priority: normal
severity: normal
status: open
title: Add base for enumerations (Functional API)
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21706>
_______________________________________


More information about the New-bugs-announce mailing list