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
After upgrading mypy to 0.930 I'm finding new confusing errors that I think are incorrect (false positives)
To Reproduce
This example may not be strictly minimal, but it's close to the real case example where I discovered the new error, while still being much more concise.
# t.pyfromtypingimportTuple, ListElementT=Tuple[str, Tuple[str, List[str]]]
ContainerT=Tuple[ElementT, ...]
a: ContainerT=tuple((f1, (f2, [])) forf1, f2in (("", ""), ("", "")))
b: ContainerT= (("", ("", [])),)
# The following four lines should be equally valid (or invalid) regarding types# but only the last one raises an errorc1: ContainerT=a+b# works fine !c2: ContainerT=b+a# this too !c3: ContainerT=a+ (("", ("", [])),) # also worksc4: ContainerT= (("", ("", [])),) +a# but this doesn't
$ mypy t.py
t_typ.py:16: error: Incompatible types in assignment (expression has type "Tuple[Union[Tuple[str, Tuple[str, List[<nothing>]]], Tuple[str, Tuple[str, List[str]]]], ...]", variable has type "Tuple[Tuple[str, Tuple[str, List[str]]], ...]")
Found 1 error in 1 file (checked 1 source file)
Expected Behavior
No error (this example type-checks with mypy 0.910)
Your Environment
Mypy version used: 0.910 and 0.930
Mypy command-line flags: none
Mypy configuration options from mypy.ini (and other config files): none
Python version used: 3.10
Operating system and version: MacOS 12.0.1
The text was updated successfully, but these errors were encountered:
Bug Report
After upgrading mypy to 0.930 I'm finding new confusing errors that I think are incorrect (false positives)
To Reproduce
This example may not be strictly minimal, but it's close to the real case example where I discovered the new error, while still being much more concise.
Expected Behavior
No error (this example type-checks with mypy 0.910)
Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: