@@ -2503,14 +2503,14 @@ from typing import Union, Dict, List
25032503def f() -> List[Union[str, int]]:
25042504 x = ['a']
25052505 return x # E: Incompatible return value type (got "List[str]", expected "List[Union[str, int]]") \
2506- # N: "List " is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
2506+ # N: "list " is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
25072507 # N: Consider using "Sequence" instead, which is covariant \
25082508 # N: Perhaps you need a type annotation for "x"? Suggestion: "List[Union[str, int]]"
25092509
25102510def g() -> Dict[str, Union[str, int]]:
25112511 x = {'a': 'a'}
25122512 return x # E: Incompatible return value type (got "Dict[str, str]", expected "Dict[str, Union[str, int]]") \
2513- # N: "Dict " is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
2513+ # N: "dict " is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
25142514 # N: Consider using "Mapping" instead, which is covariant in the value type \
25152515 # N: Perhaps you need a type annotation for "x"? Suggestion: "Dict[str, Union[str, int]]"
25162516
@@ -2522,7 +2522,7 @@ def h() -> Dict[Union[str, int], str]:
25222522def i() -> List[Union[int, float]]:
25232523 x: List[int] = [1]
25242524 return x # E: Incompatible return value type (got "List[int]", expected "List[Union[int, float]]") \
2525- # N: "List " is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
2525+ # N: "list " is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance \
25262526 # N: Consider using "Sequence" instead, which is covariant
25272527
25282528[builtins fixtures/dict.pyi]
0 commit comments