summaryrefslogtreecommitdiff
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2014-10-14 08:58:32 -0700
committerEthan Furman <ethan@stoneleaf.us>2014-10-14 08:58:32 -0700
commit318f9df3d4a78af6edfebb66b013482a7e971d4c (patch)
tree6cb1f8ed6c46bea59ed9efe28be7d2847abb96e0 /Lib/enum.py
parent98aaf5861410e3b346a0f3417d04490fdac867c7 (diff)
downloadcpython-318f9df3d4a78af6edfebb66b013482a7e971d4c.tar.gz
Issue22506: added methods on base Enum class now show up in dir of Enum subclass (3.4)
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 84fa20e110..9b19c1d34b 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -464,7 +464,12 @@ class Enum(metaclass=EnumMeta):
return "%s.%s" % (self.__class__.__name__, self._name_)
def __dir__(self):
- added_behavior = [m for m in self.__class__.__dict__ if m[0] != '_']
+ added_behavior = [
+ m
+ for cls in self.__class__.mro()
+ for m in cls.__dict__
+ if m[0] != '_'
+ ]
return (['__class__', '__doc__', '__module__', 'name', 'value'] +
added_behavior)