-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
TypeVar
constrained to Literal[True]
and Literal[False]
is resolved to bool
#6917
Comments
…TypeVar includes literal types as constraints. This addresses #6917.
Thanks for the bug report. This will be addressed in the next release. |
Thanks for the fix! I see in the PR that you are special casing literals. Should this be added to the spec in some way? (for the record mypy is not inferring the case without an explicit |
Maybe, although in this case I don't think there's any ambiguity because the constraints imposed on the TypeVar (in this case, value constraints) require that the solved type is a literal. The issue with mypy in this case is not because it doesn't solve |
This is addressed in pyright 1.1.345, which I just published. It will also be included in a future release of pylance. |
Following #6914:
Code sample in pyright playground
The text was updated successfully, but these errors were encountered: