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
pylance doesn't report an issue but pyright does.
I tried to follow USING_WITH_PYRIGHT.md but I can't seem to find what's the difference between the tools.
Revealed type is "Literal[SomeEnum.ENUM_VALUE] | None" for pylance but "Unknown | None" for pyright (plus the reportInvalidTypeForm error).
It looks like pylance is able to infer that _ENUM_VALUE is a litteral value.
This is due to the fact that pylance is using a slightly-older version of pyright. Once pylance upgrades to the latest version, you will see the same error in both places.
Your code is using a variable in a type annotation, which is explicitly forbidden by the python typing spec. There was a bug in pyright where it didn't always report this error, and I recently fixed the bug.
Thank you very much for the quick answer 👍 I'm aware this snippet uses invalid constructs, it's from a third party library and I wanted to be sure where the error was coming from.
Is CHANGELOG.md the right place to know about the pyright version shipped with pylance or can it be fetched somewhere else?
Environment data
Code Snippet
Repro Steps
pyright
(Playground )Expected behavior
Both tools report the same issues.
Actual behavior
pylance
doesn't report an issue butpyright
does.I tried to follow USING_WITH_PYRIGHT.md but I can't seem to find what's the difference between the tools.
Revealed type is
"Literal[SomeEnum.ENUM_VALUE] | None"
forpylance
but"Unknown | None"
forpyright
(plus thereportInvalidTypeForm
error).It looks like
pylance
is able to infer that_ENUM_VALUE
is a litteral value.Logs
Trace logging
The text was updated successfully, but these errors were encountered: