Closed
Description
Despite the update in #1195, I still get an error when accessing an Enum's __members__
attribute with mypy 0.521 and Python 3.6.2:
import enum
class NetworkEventName(str, enum.Enum):
CONNECTED = "connected"
DISCONNECTED = "disconnected"
CLOSE_REQUEST = "close_request"
MESSAGE = "message"
RAW_LINE = "raw_line"
print(NetworkEventName.__members__)
> mypy /tmp/enum_test.py
/tmp/enum_test.py:12: error: Type[NetworkEventName] has no attribute "__members__"
> python /tmp/enum_test.py
OrderedDict([('CONNECTED', <NetworkEventName.CONNECTED: 'connected'>), ('DISCONNECTED', <NetworkEventName.DISCONNECTED: 'disconnected'>), ('CLOSE_REQUEST', <NetworkEventName.CLOSE_REQUEST: 'close_request'>), ('MESSAGE', <NetworkEventName.MESSAGE: 'message'>), ('RAW_LINE', <NetworkEventName.RAW_LINE: 'raw_line'>)])
Lines 12 to 13 in 385b9c8
Metadata
Metadata
Assignees
Labels
No labels