summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2016-09-02 06:55:19 (GMT)
committerEthan Furman <ethan@stoneleaf.us>2016-09-02 06:55:19 (GMT)
commit65a5a47d799184bf69c8f0eb6004c701ff8f7d90 (patch)
treeb479c2036db26efad1a32e31b2056c2db3f30d7c /Lib/enum.py
parentc19f00b238962a6ff18179ed3122ce9c14558566 (diff)
downloadcpython-65a5a47d799184bf69c8f0eb6004c701ff8f7d90.zip
cpython-65a5a47d799184bf69c8f0eb6004c701ff8f7d90.tar.gz
cpython-65a5a47d799184bf69c8f0eb6004c701ff8f7d90.tar.bz2
issue23591: add docs; code cleanup; more tests
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index e89c17d..8369631 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -10,7 +10,7 @@ except ImportError:
from collections import OrderedDict
-__all__ = ['EnumMeta', 'Enum', 'IntEnum', 'Flags', 'IntFlags', 'unique']
+__all__ = ['EnumMeta', 'Enum', 'IntEnum', 'Flag', 'IntFlag', 'unique']
def _is_descriptor(obj):
@@ -104,7 +104,7 @@ class EnumMeta(type):
enum_dict['_generate_next_value_'] = getattr(first_enum, '_generate_next_value_', None)
return enum_dict
- def __new__(metacls, cls, bases, classdict, **kwds):
+ def __new__(metacls, cls, bases, classdict):
# an Enum class is final once enumeration items have been defined; it
# cannot be mixed with other types (int, float, etc.) if it has an
# inherited __new__ unless a new __new__ is defined (or the resulting
@@ -614,7 +614,7 @@ class IntEnum(int, Enum):
def _reduce_ex_by_name(self, proto):
return self.name
-class Flags(Enum):
+class Flag(Enum):
"""Support for flags"""
@staticmethod
def _generate_next_value_(name, start, count, last_value):
@@ -736,7 +736,7 @@ class Flags(Enum):
return self.__class__(inverted)
-class IntFlags(int, Flags):
+class IntFlag(int, Flag):
"""Support for integer-based Flags"""
@classmethod