You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting Too many arguments for "Enum" from mypy. I'm guessing it needs an __init__ function?
Not sure how this should be handled. It's dynamic, so I take it there's no real way to provide type safety for this syntax? But maybe something should be done to not throw an error when it is used?
The text was updated successfully, but these errors were encountered:
I believe that this is actually a deficiency in mypy's special-casing of enums. As long as the argument is a literal (not a dynamically constructed string) this could be made to work by special-casing this. See e.g. python/mypy#529 (comment)
I'm closing this here because I don't think a change to typeshed would be sufficient (though it might be needed too).
@MartinThoma mypy supports at least some versions of the functional enum API (python/mypy#2805). If some variation doesn't work for you yet, you should report an issue to mypy (not typeshed) with the exact code that is not working.
https://docs.python.org/3/library/enum.html#functional-api
I'm getting
Too many arguments for "Enum"
from mypy. I'm guessing it needs an__init__
function?Not sure how this should be handled. It's dynamic, so I take it there's no real way to provide type safety for this syntax? But maybe something should be done to not throw an error when it is used?
The text was updated successfully, but these errors were encountered: