We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug Report
Mypy emits a spurious error when using the python builtin list as the first argument to the python builtin map
list
map
To Reproduce
from typing import List x: List[str] = list(map(str, range(5))) # works y: List[List[str]] = list(map(list, x)) # fails z: List[str] = list("1") # works
Expected Behavior
I would expect no error. The builtin in list should satisfy the expected type Callable[[str], List[_T]].
Callable[[str], List[_T]]
(Write what you thought would happen.)
Actual Behavior
running mypy on this yields error: Argument 1 to "map" has incompatible type "Type[List[Any]]"; expected "Callable[[str], List[_T]]"
error: Argument 1 to "map" has incompatible type "Type[List[Any]]"; expected "Callable[[str], List[_T]]"
Your Environment
mypy.ini
The text was updated successfully, but these errors were encountered:
This looks like a duplicate of #9253
Sorry, something went wrong.
Agreed.
No branches or pull requests
Bug Report
Mypy emits a spurious error when using the python builtin
list
as the first argument to the python builtinmap
To Reproduce
Expected Behavior
I would expect no error. The builtin in
list
should satisfy the expected typeCallable[[str], List[_T]]
.(Write what you thought would happen.)
Actual Behavior
running mypy on this yields
error: Argument 1 to "map" has incompatible type "Type[List[Any]]"; expected "Callable[[str], List[_T]]"
Your Environment
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: