-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
is_dataclass(Any)
return type incorrect, differs from is_dataclass(object)
#12401
Comments
I don't think there is a fix, as |
As a hack, we could add another overload case, with argument type that no real type ever satisfies but only |
Refs python/mypy#17579 |
@intgr We could try your suggestion in an experimental PR. (We should definitely add tests, though.) Otherwise I would close this issue as unfixable. |
MyPy PR is here: python/mypy#17678 |
I found this surprising and arguably incorrect. According to mypy:
(Mypy playground)
This is because
Any
matches the 1st overload, even if 2nd overload withobject
argument is more appropriate forAny
:I couldn't think of an elegant fix for this.
The text was updated successfully, but these errors were encountered: