You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because of the way choice is defined in the community-maintained typeshed type stubs that are bundled with pylance. You can see here that choice is actually declared as a variable rather than a function. The variable is initialized with a reference to the Random.choice method.
My apologies, I meant to include screenshots of exactly that as additional context. However, I have distinct memories of the choice function being highlighted a long time ago. Am I just misremembering?
Edit: looks like I'm not misremembering 😅 -- I am still curious though why Pylance wouldn't "resolve" the bound method referenced by the variable?
Environment data
Code Snippet
Settings:
Repro Steps
"editor.semanticHighlighting.enabled": true
random
moduleExpected behavior
The imported function should be highlighted as a function (typically blue), and the documentation on mouse hover should report it as a function.
Actual behavior
The imported function is un-highlighted and is reported as a variable on mouse hover.
Logs
The text was updated successfully, but these errors were encountered: