summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-12-25 08:07:30 -0800
committerGitHub <noreply@github.com>2020-12-25 08:07:30 -0800
commitfbffda25b4b5f537e651eaab4ca1ec4cde800709 (patch)
treeb054bdf1899ed0a623bfa94b012758a0a9a33493
parent51f502914656a1f8e8ffdf6e1b06f670d8fea8ed (diff)
downloadcpython-git-fbffda25b4b5f537e651eaab4ca1ec4cde800709.tar.gz
bpo-42727: [Enum] use super() and include **kwds (GH-23927)
for multiple inheritance support: use super().new pass **kwds to super().new (cherry picked from commit 786d97a66cac48e7a933010367b8993a5b3ab85b) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
-rw-r--r--Lib/enum.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index aa9f4b00dd..1c22380f03 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -227,10 +227,10 @@ class EnumMeta(type):
# create our new Enum type
if bases:
bases = (_NoInitSubclass, ) + bases
- enum_class = type.__new__(metacls, cls, bases, classdict)
+ enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
enum_class.__bases__ = enum_class.__bases__[1:] #or (object, )
else:
- enum_class = type.__new__(metacls, cls, bases, classdict)
+ enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
old_init_subclass = getattr(enum_class, '__init_subclass__', None)
# and restore the new one (if there was one)
if new_init_subclass is not None: