-
I might be doing something wrong, but trying this code: def a()->Literal['a','b','c']:
return 'a'
if a()=='x':
print('x') it does not show an error, not does it with anything else replaced on I expect that we could get typehint both for different literals, and for different data types. |
Beta Was this translation helpful? Give feedback.
Answered by
erictraut
Dec 18, 2024
Replies: 1 comment 1 reply
-
If you would like pyright to detect condition tests where the operands appear to have no type overlap, you can enable the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ghsanti
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you would like pyright to detect condition tests where the operands appear to have no type overlap, you can enable the
reportUnnecessaryComparison
check. This check is not enabled by default.