-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
error: Enum() expects a string, tuple, list or dict literal as the second argument #5317
Comments
Mypy needs to be able to determine the enum members during static analysis. It's unlikely that we'll ever gain support for most of the cases you mention. |
Thank you, I understand it. :) |
I think the message is misleading. It's not |
At least with mypy 0.971 |
@JelleZijlstra This is perfectly understandable, but given this is a mypy limitation, can we please reopen this to change the misleading message, as @dvarrazzo suggested? Instead of: How about: |
Hello,
I'm reporting corner cases around at second argument of enum.Enum, which can be dict-like object.
Documentation says:
But mypy says:
If mypy reports the error in these cases expectedly, please feel free to close this issue.
Thanks.
Not sure since I don't have clear understanding on what mypy scopes as of now.
HERE is the TODO comment that I refer.
or
or
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
mypy-0.620+dev.f5058bcb269a55b33a02c3e3fd345541839bf06e
Nothing.
n/a.
See also python/typeshed#2305
The text was updated successfully, but these errors were encountered: