This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cool-RR
Recipients cool-RR
Date 2014-09-27.14:57:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411829845.48.0.985714520453.issue22506@psf.upfronthosting.co.za>
In-reply-to
Content
Calling `dir` on an enum subclass shows only the contents of that class, not its parent classes. In normal classes, you can do this: 

    Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> class A:
    ...   x = lambda self: 7
    ...
    >>> class B(a): pass
    ...
    >>> assert 'x' in dir(B)

But in enum subclasses, it fails:
    
    >>> import enum
    >>> class A(enum.Enum):
    ...   x = lambda self: 7
    ...
    >>> class B(A):
    ...   pass
    ...
    >>> assert 'x' in dir(B)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AssertionError
    >>>

Looks like the `__dir__` implementation needs to be tweaked.
History
Date User Action Args
2014-09-27 14:57:25cool-RRsetrecipients: + cool-RR
2014-09-27 14:57:25cool-RRsetmessageid: <1411829845.48.0.985714520453.issue22506@psf.upfronthosting.co.za>
2014-09-27 14:57:25cool-RRlinkissue22506 messages
2014-09-27 14:57:24cool-RRcreate