-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Enum.__members__ not recognized #1590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I wonder if this is a mypy bug, since the property is present on the metaclass in typeshed. cc @elazarg who implemented a lot of the metaclass support in mypy. |
It seems to happen due to a spurious "inconsistent metaclass structure". str implements Sequence, and therefore has ABC in its MRO. This means NetworkEventName has both EnumMeta and ABCMeta in the meta-mro, neither of which is a subclass of the other. This is the pretty much same problem as with IntEnum. |
(so this is not a mypy bug, in my opinion) |
In essence, this is duplicate of the more general python/mypy#2824 |
Seems like it, indeed. I'm closing this then. |
Even more general: #1595. |
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:typeshed/stdlib/3.4/enum.pyi
Lines 12 to 13 in 385b9c8
The text was updated successfully, but these errors were encountered: