]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42385: [Enum] add `_generate_next_value_` to StrEnum (GH-23735)
authorEthan Furman <ethan@stoneleaf.us>
Thu, 10 Dec 2020 20:20:06 +0000 (12:20 -0800)
committerGitHub <noreply@github.com>
Thu, 10 Dec 2020 20:20:06 +0000 (12:20 -0800)
commitefb13be72cbf49edf591936fafb120fe1b7d59f7
treeb35ffdea85d002cac1789a48c99287e5ca75a358
parent9fc571359af9320fddbe4aa2710a767f168c1707
bpo-42385: [Enum] add `_generate_next_value_` to StrEnum (GH-23735)

The default for auto() is to return an integer, which doesn't work for `StrEnum`.  The new `_generate_next_value_` for `StrEnum` returns the member name, lower cased.
Doc/library/enum.rst
Lib/enum.py
Lib/test/test_enum.py
Misc/NEWS.d/next/Library/2020-12-09-19-45-32.bpo-42385.boGbjo.rst [new file with mode: 0644]