]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-91456: [Enum] Deprecate default auto() behavior with mixed value types (GH-91457)
authorOscar R <89599049+oscar-LT@users.noreply.github.com>
Thu, 23 Jun 2022 06:20:24 +0000 (02:20 -0400)
committerGitHub <noreply@github.com>
Thu, 23 Jun 2022 06:20:24 +0000 (23:20 -0700)
commitfb1e9506c14ef32d5bec126dad6fa769c8c054f6
tree07415da3086cd6eccf5ad0b17519ebc4b9eda80e
parent7c439dca13435085efb2fddf9ac75e5305db7ada
gh-91456: [Enum] Deprecate default auto() behavior with mixed value types (GH-91457)

When used with plain Enum, auto() returns the last numeric value assigned, skipping any incompatible member values (such as strings); starting in 3.13 the default auto() for plain Enums will require all the values to be of compatible types, and will return a new value that is 1 higher than any existing value.

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Doc/library/enum.rst
Lib/enum.py
Lib/test/test_enum.py
Misc/NEWS.d/next/Library/2022-04-11-16-55-41.gh-issue-91456.DK3KKl.rst [new file with mode: 0644]