summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2013-08-04 15:42:23 (GMT)
committerEthan Furman <ethan@stoneleaf.us>2013-08-04 15:42:23 (GMT)
commit5e5a8230c206e5762b5d4c0708189422c1b1f3b1 (patch)
treed2e7c6f0cd4a05d60fcd14b4b4daaf6eed897fa8 /Lib/enum.py
parentaf760db0670a8891ea160111b24eabcea2088223 (diff)
downloadcpython-5e5a8230c206e5762b5d4c0708189422c1b1f3b1.zip
cpython-5e5a8230c206e5762b5d4c0708189422c1b1f3b1.tar.gz
cpython-5e5a8230c206e5762b5d4c0708189422c1b1f3b1.tar.bz2
Close #18635: Move class level private attribute from instance to class.
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 33af042..34eb7b8 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -127,6 +127,7 @@ class EnumMeta(type):
enum_class = super().__new__(metacls, cls, bases, classdict)
enum_class._member_names_ = [] # names in definition order
enum_class._member_map_ = OrderedDict() # name->value map
+ enum_class._member_type_ = member_type
# Reverse value->name map for hashable values.
enum_class._value2member_map_ = {}
@@ -159,7 +160,6 @@ class EnumMeta(type):
if not hasattr(enum_member, '_value_'):
enum_member._value_ = member_type(*args)
value = enum_member._value_
- enum_member._member_type_ = member_type
enum_member._name_ = member_name
enum_member.__init__(*args)
# If another member with the same value was already defined, the