Literal
, get_args
and list comprehension false positive
#13094
Labels
bug
mypy got something wrong
topic-literal-types
topic-type-narrowing
Conditional type narrowing / binder
Bug Report
Looks like mypy fail to consider that the following code is valid where pyright deals correctly with it. I think it is a false positive.
To Reproduce
Expected Behavior
I don't think it should throw an error since
name
is a_Names
. Pyright is seeing this as correct code.Actual Behavior
It is failing with the following error when copying the code in a file and running
poetry run mypy ./test_literal.py --show-error-codes
Your Environment
0.941
and0.961
3.9.10
Ubuntu 22.04 LTS
The text was updated successfully, but these errors were encountered: