Skip to content
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

Errors with mypy 0.740 #3467

Closed
max-sixty opened this issue Oct 30, 2019 · 5 comments
Closed

Errors with mypy 0.740 #3467

max-sixty opened this issue Oct 30, 2019 · 5 comments

Comments

@max-sixty
Copy link
Collaborator

max-sixty commented Oct 30, 2019

mypy .                    

xarray/core/common.py:337: error: Too few arguments for "__init_subclass__"
xarray/core/dataset.py:398: error: Too few arguments for "__init_subclass__"
xarray/core/dataset.py:873: error: Incompatible default for argument "attrs" (default has type "object", argument has type "Optional[Dict[Hashable, Any]]")
xarray/core/dataset.py:874: error: Incompatible default for argument "indexes" (default has type "object", argument has type "Optional[Dict[Any, Any]]")
xarray/core/dataset.py:875: error: Incompatible default for argument "encoding" (default has type "object", argument has type "Optional[Dict[Any, Any]]")
xarray/core/dataset.py:922: error: Incompatible default for argument "attrs" (default has type "object", argument has type "Optional[Dict[Hashable, Any]]")
xarray/core/dataset.py:923: error: Incompatible default for argument "indexes" (default has type "object", argument has type "Dict[Hashable, Any]")
xarray/core/dataset.py:937: error: Incompatible default for argument "attrs" (default has type "object", argument has type "Dict[Hashable, Any]")
xarray/core/dataarray.py:213: error: Too few arguments for "__init_subclass__"
Found 9 errors in 3 files (checked 122 source files)

mypy --version
mypy 0.740
@crusaderky
Copy link
Contributor

It's a regression in mypy 0.740, already fixed in git tip. python/mypy#7735

@max-sixty
Copy link
Collaborator Author

Great!

Are we OK for the Incompatible default too?

@crusaderky
Copy link
Contributor

That's a change in which line mypy expects the type: ignore to be when you have a multi - line function header and only one of the argument trips an error. The only way to make the code pass both 0.730 and 0.740 is put type: ignore in both places, which I'd rather avoid.

@max-sixty
Copy link
Collaborator Author

Great, so we can make the change when we upgrade on the next release?

@crusaderky
Copy link
Contributor

Correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants