diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2014-10-14 15:58:32 (GMT) |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2014-10-14 15:58:32 (GMT) |
commit | 0ae550bdde7cc87defb89dd19c912bf4485619f5 (patch) | |
tree | 638b4189cb1801788c1183c3903423b93cccc9a3 /Lib/enum.py | |
parent | 39892055cdd560c9ddb895bfd2b82c3c31329218 (diff) | |
download | cpython-0ae550bdde7cc87defb89dd19c912bf4485619f5.zip cpython-0ae550bdde7cc87defb89dd19c912bf4485619f5.tar.gz cpython-0ae550bdde7cc87defb89dd19c912bf4485619f5.tar.bz2 |
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.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/enum.py b/Lib/enum.py index 84fa20e..9b19c1d 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) |