FIX: got rid of type: ignore[unreachable] comments #221#394
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #394 +/- ##
=======================================
Coverage 83.21% 83.21%
=======================================
Files 96 96
Lines 11429 11430 +1
=======================================
+ Hits 9511 9512 +1
Misses 1918 1918 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Saransh-cpp
left a comment
There was a problem hiding this comment.
Thanks for taking this up, @Saswatsusmoy! Could you please add warn_unreachable = true under the [tool.mypy] section in pyproject.toml to check if this works?
No, it isn't working 16 errors have popped up src\vector_methods.py:3949: error: Statement is unreachable [unreachable] Can you please help me with this? |
Description
Fixes #221
To fix this, we can use a TypeVar to bound the input cls to VectorProtocol. This avoids the inconsistent inheritance issue.
We also don't need the unreachable ignores anymore since the code now typechecks correctly.
Checklist
$ pre-commit run --all-filesor$ nox -s lint)$ pytestor$ nox -s tests)$ cd docs; make clean; make htmlor$ nox -s docs)$ xdoctest ./src/vectoror$ nox -s doctests)Before Merging