-
Notifications
You must be signed in to change notification settings - Fork 767
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
Pylance thinks an attribute is unknown despite "Go to Type Definition" working. Pyright passes. winsdk #5202
Comments
This comment was marked as resolved.
This comment was marked as resolved.
I'm not able to repro the problem above. I wonder if your Pylance install or your venv are corrupt. Are you able to repro the problem with a fresh project and fresh venv? |
Fresh new project, new venv, as soon as I set
Could be, in case it was a cache thing I found and ran "Pylance: Clear All Persisted Indices" + "Python: Clear Cache and Reload Window" commands. No change. Worth noting I don't have the |
That's the error I couldn't repro. I didn't try to repro the other issue because the |
Having same issue with updating python extension yesterday. Switched to the pre-release hoping it would resolve the issue but it hasn't. |
Yes, I've set I don't see any diagnostics when using the latest Pylance release version (2023.11.10) either. |
Using the following minimal repro: from winsdk.windows.media.capture import MediaCapture
async def foo():
await MediaCapture().initialize_async() # "IAsyncAction" is not awaitable Pylance[reportGeneralTypeIssues] (because as mentioned previously, the rest of the issues only happen in strict mode on pre-release, so maybe we can focus on this first) I have bisected this diagnostic to show starting I understand I may have two different issues here (the "not awaitable" from |
Ok I found the difference in configs! I believe I've previously kept this to false in my editor because
So idk what changed in pyright |
I'll close this as "working as intended". My issue (ie: desync with pyright) boils down to updating an old config after a change in pyright I was not aware of. Thank you for your time. Now that pyright and pylance agree on my side, if the behaviour seen was unexpected with |
Environment data
Code Snippet
Here's my code snippet, without my own comments, and I added Pylance reported errors as comments
Repro Steps
python -m pip install winsdk==1.0.0b10
Expected behavior
Full type to be known by Pylance, not partially Unknown
Pyright:
information: Type of "direct_3d_device" is "IDirect3DDevice | None"
Actual behavior
Partial Unknowns
Pylance:
Logs
Python Language Server log.txt
The text was updated successfully, but these errors were encountered: