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
Enable checking of untyped definitions #1612
Conversation
@@ -833,7 +834,7 @@ def __getstate__(self): | |||
|
|||
def __setstate__(self, state): | |||
root, cls = state | |||
self.__init__(root=root, cls=cls) | |||
self.__init__(root=root, cls=cls) # type: ignore[misc] |
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.
These igore statements are all for the following warning. I'm not sure if there's a good way to fix instead of ignoring the warning?
Accessing "init" on an instance is unsound, since instance.init could be from an incompatible subclass
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.
pretty sure the right thing here is to define__reduce__
, which I started over in #1089. It's stalled, but very simple to pick up I think
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.
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.
I think blinding mypy to our sins with #type: ignore
is fine for now
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1612 +/- ##
=======================================
Coverage 99.98% 99.99%
=======================================
Files 38 38
Lines 14640 14575 -65
=======================================
- Hits 14638 14574 -64
+ Misses 2 1 -1
|
1537d6d
to
6373139
Compare
Anything more to do here before this can be merged? |
46493b3
to
8c58328
Compare
I'll close this since it's gone in to the v3 branch |
This enables some more mypy checks. The first two didn't need any fixes.
check_untyped_defs
requires quite a lot of fixes. I've made some of them, and added a list of modules that need a lot of fixes to ignore for now. The idea here is that at least in any other newly added modules untyped definitions will be checked.TODO: