summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2023-09-08 01:19:03 (GMT)
committerGitHub <noreply@github.com>2023-09-08 01:19:03 (GMT)
commitc74e440168fab9bf91346471087a394af13fa2db (patch)
treee9afe2d0f55fff41ed232a524b6ef76694dc76b2 /Misc
parentb9831e5c98de280870b6d932033b868ef56fa2fa (diff)
downloadcpython-c74e440168fab9bf91346471087a394af13fa2db.zip
cpython-c74e440168fab9bf91346471087a394af13fa2db.tar.gz
cpython-c74e440168fab9bf91346471087a394af13fa2db.tar.bz2
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=())
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2023-09-06-19-33-41.gh-issue-108682.35Xnc5.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2023-09-06-19-33-41.gh-issue-108682.35Xnc5.rst b/Misc/NEWS.d/next/Library/2023-09-06-19-33-41.gh-issue-108682.35Xnc5.rst
new file mode 100644
index 0000000..8c13d43
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-09-06-19-33-41.gh-issue-108682.35Xnc5.rst
@@ -0,0 +1,2 @@
+Enum: require ``names=()`` or ``type=...`` to create an empty enum using
+the functional syntax.