We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 version: v2024.10.101 (pre-release) OS and version: Windows 10
Here is a simple example, the default value of x is dependent on the OS.
x
import os from dataclasses import dataclass, field FOO = 1 BAR = 2 @dataclass class A: x: int = field(default=FOO if os.name == "nt" else BAR)
I would expect both FOO and BAR to highlighted blue and hovering should show
FOO
BAR
(constant) FOO: Literal[1]
and
(constant) BAR: Literal[2]
Notice how BAR isn't highlighted in blue, it is white. And if I hover BAR it says
(function) BAR: Any
If I test this same MRE on a macOS machine, then the bug swaps around. FOO becomes white and (function) instead.
(function)
The text was updated successfully, but these errors were encountered:
StellaHuang95
No branches or pull requests
Pylance version: v2024.10.101 (pre-release)
OS and version: Windows 10
MRE
Here is a simple example, the default value of
x
is dependent on the OS.Expected behavior
I would expect both
FOO
andBAR
to highlighted blue and hovering should showand
Actual behavior
Notice how
BAR
isn't highlighted in blue, it is white. And if I hoverBAR
it saysIf I test this same MRE on a macOS machine, then the bug swaps around.
FOO
becomes white and(function)
instead.The text was updated successfully, but these errors were encountered: