]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-109022: [Enum] require `names=()` to create empty enum type (GH-109048)
authorEthan Furman <ethan@stoneleaf.us>
Fri, 8 Sep 2023 01:19:03 +0000 (18:19 -0700)
committerGitHub <noreply@github.com>
Fri, 8 Sep 2023 01:19:03 +0000 (18:19 -0700)
commitc74e440168fab9bf91346471087a394af13fa2db
treee9afe2d0f55fff41ed232a524b6ef76694dc76b2
parentb9831e5c98de280870b6d932033b868ef56fa2fa
gh-109022: [Enum] require `names=()` to create empty enum type (GH-109048)

add guard so that ``Enum('bar')`` raises a TypeError instead of
creating a new enum class called `bar`.  To create the new but
empty class, use:

    huh = Enum('bar', names=())
Lib/enum.py
Lib/test/test_enum.py
Misc/NEWS.d/next/Library/2023-09-06-19-33-41.gh-issue-108682.35Xnc5.rst [new file with mode: 0644]