Closed pechersky closed 2 months ago
Same issue here
I have a similar issue with VSCode. But I am using pyright. I haven't configured an explicit linter. I think pyright can be the default linter, and if you haven't configured an explicit linter, when you hover over the types, pyright is the one populating those types you see. Might be a vscode or pyright issue as well
Seems like the issue is being tracked here: https://github.com/microsoft/pyright/discussions/8608
I think this is unrelated to mypy, is issue with pylance / pyright
Upgrading to the latest Pylance version helped solved this issue for me!
Bug Report
(A clear and concise description of what the bug is.)
To Reproduce
I have pytest-asyncio and requests installed in my python environment, with mypy==1.11.1. I use VSCode as my IDE. Once I installed pytest-asyncio, the inferred type annotations for many things got much more complex, and now say: FixtureFunction[SimpleFixtureFunction@FixtureFunction, FactoryFixtureFunction@FixtureFunction] I also think these catch-all typevars end up slowing down the mypy typechecking, but that's only a guess.
Here is an example (sorry for the screenshot, not sure how to get command line output to display this): Uninstalling and then reinstalling pytest-asyncio seems to have resolved the issue, but colleagues have this issue too when they start new environments.
cf: https://github.com/pytest-dev/pytest-asyncio/issues/919
Expected Behavior
In this example, I would expect to see the function arguments be
Any | None = None
Actual Behavior
Even outside of this simple example, many types were aberrantly annotated as this
FixtureFunction
before my uninstall/reinstall.Your Environment
mypy.ini
(and other config files): in VSCode