-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
mypy always fails with Python 3.10 match statement #11829
Comments
The match statement is not yet supported in mypy. See #10191. |
@srittau That's OK. I am just asking Mypy to ignore match block, but it still raises the error. It seems it could be trivial to make it to respect "type: ignore"? Lines 1289 to 1293 in 9e34f6a
|
its not supported in mypy yet :/ and ignore doesn't work yet python/mypy#11829 This reverts commit d86a269.
That indeed seems like a regression. At least in mypy 0.910, the match statement could be ignored. |
@srittau downgraded to mypy 0.910, the error is still the same
|
@srittau is there a way to properly ignore the |
I'm not sure. I thought it had worked for me with 0.910, but when I downgraded, it failed too. |
Looks like proper |
It has been merged |
When this is going to be available on pypi? I am still having issues with my build using the latest version. |
There are no concrete plans for the next release yet. |
I'm hoping that we will have a feature release sometime in February. |
This issue can be used to track progress on the next feature release which will support the match statement: |
As have I unfortunately... I've tried adding Are there any sort of temporary fixes in the meantime, or do I just need to ignore the red squiggles in my IDE for now, lol? |
I had to disable mypy until this gets released. |
While there is no release you can install mypy on the commit that includes this initial support for match statements:
The commit above is the first commit after 9b63751 where the CI succeeds. |
I can absolutely appreciate that mypy needs time to support newer features. I'm confused on the choice here, though, to return an error. What is the reasoning behind classifying the result this way? |
I'm relying on mypy to type-check my code. If I'm using language features that mypy does not support, I think it's good to receive a warning in places where I cannot rely on it. The fact that you couldn't suppress the warning was bad, but probably an honest mistake. |
Certainly agree with the warning. It would be awkward to just have mypy be silent when it can't process some syntax at all. If the fact that it raises an error was in error, that's certainly my misunderstanding of the issue here. Thanks! 👍 |
It's good to have an option to install from git branch to local. But it doesn't solve pre-commit hooks problems. |
Any updates on this? I'm using mypy 1.3.0 and this is still throwing the error |
That probably means you're not running mypy with Python 3.10 or newer (or you're not actually running mypy 1.3). Try |
Yes, you're right. I hadn't updated my .mypy.ini from a previous project to state python_version=3.10. Thank you! |
I still have this in mypy 1.6.1 for mac. Python 3.10.13 |
Please consider:
then
I would expect Mypy to ignore the whole match block.
Or is there an option I am missing, which I can pass to Mypy?
Mypy 0.930, Python 3.10.1.
The text was updated successfully, but these errors were encountered: