-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add modules to check-untyped
#8242
Conversation
In reviewing pydata#8241, I realize that we actually want `check-untyped-defs`, which is a bit less strict, but lets us add some more modules on. I did have to add a couple of ignores, think it's a reasonable tradeoff to add big modules like `computation` on. Errors with this enabled are actual type errors, not just `mypy` pedanticness, so would be good to get as much as possible into this list...
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of minor remarks, some are more my personal opinion than actual rules...
Co-authored-by: Michael Niklas <[email protected]>
for more information, see https://pre-commit.ci
xarray/core/dataset.py
Outdated
@@ -1478,7 +1478,7 @@ def __iter__(self) -> Iterator[Hashable]: | |||
if TYPE_CHECKING: | |||
# needed because __getattr__ is returning Any and otherwise | |||
# this class counts as part of the SupportsArray Protocol | |||
__array__ = None | |||
__array__ = None # type: ignore[var-annotated,unused-ignore] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I was getting this locally but not in CI — not sure why — but on balance seems reasonable to exclude. Possible a dependency issue; we can try removing some of these ignore[unused-ignore]
in the future manually, given they definitionally elude our other checks...
@Illviljan is it OK if I merge? There may be small conflicts with #8241 — which seems unfair given you inspired these changes! Or merge #8241 and I'll resolve conflicts (unless you disagree, I'll merge later today, hope that's OK...) |
Thanks @max-sixty ! |
In reviewing #8241, I realize that we actually want
check-untyped-defs
, which is a bit less strict, but lets us add some more modules on. I did have to add a couple of ignores, think it's a reasonable tradeoff to add big modules likecomputation
on.Errors with this enabled are actual type errors, not just
mypy
pedanticness, so would be good to get as much as possible into this list...