-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix: test setter on df.columns with pyright, not mypy #484
Conversation
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.
Does this new way of ignoring mypy-only errors allow enabling mypy's and pyright's check for unneeded ignores?
For mypy, the answer is no. See python/mypy#14365 I wanted to add a test like this: if TYPE_CHECKING_INVALID_USAGE and not IS_TYPE_CHECKER_MYPY:
df.columns = "abc" # type: ignore[assignment] but mypy still checks it. Although I guess I could use a |
Could do something like at typeshed python/typeshed@23ac9bf Use |
We currently are reporting wrong ignores with If we have a line of valid code, then I think this table summarizes things
It's the third case that is causing issues for us to be able to use |
So there isn't a Mypy-only equivalent of |
Unforunately, there is not a |
pyright 1.1.286 fixed an issue that didn't allow users to write
df.columns = ["abc", "def"]
.Our testing code was not picking this up because we had
#type: ignore
comments on the testing code, which are needed because of a mypy bug.So I've instrumented the test to be checked with
pyright
, but notmypy
. Unfortunately,mypy
doesn't support amypy: ignore
comment.