Clean up existing mypy issues, run in CI. #161
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first step for #160.
Each commit here was already squashed, so should be independently reviewable (and can rebase the PR when submitting and it won't make a mess of the branch history).
There are four commits here:
Most of the fixes needed were pretty straightforward. New base classes, correcting existing annotations, adding missing annotations, introducing a few generics, etc. A very small number of APIs changed, and mostly only to correct the signature to the actual behavior (a handful of functions treat all arguments as optional even though if that behavior is relied upon the function will raise). Shouldn't be any serious impact from the changes.
Many of the function-internal issues were fixed by adding an assertion or a type-check that raises since the existing APIs can't be made type-safe without being more invasive, and IMO that's better left until after mypy is fully deployed. It might also break existing users.