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
This is another example of #12025, just with different common ancestor: str and tuple[str] are both Sequence[str], usually this manifests as object type in unexpected places, here it's a bit more friendly.
Bug Report
mypy loses information about types. 'str | tuple[str, ...]' becomes 'Sequence[str]'
To Reproduce
version 1: this fails
version 2: this works
Expected Behavior
both versions of code should run successfully
Actual Behavior
version 2 fails with the following error: 'Incompatible return value type (got "Sequence[str]", expected "str | tuple[str, ...]") [return-value]'
Your Environment
mypy version: 1.15.0
python version: 3.12
reproducible even the mypy playground
The text was updated successfully, but these errors were encountered: