Closed
Description
$ python --version
Python 3.9.1
$ mypy --version
mypy 0.790
Minimal code example:
import os
filenames = map(os.path.basename, ["hello/world.txt"])
Actual result:
$ mypy ~/test.py
/home/jon/test.py:3: error: Argument 1 to "map" has incompatible type overloaded function; expected "Callable[[str], AnyStr]"
Found 1 error in 1 file (checked 1 source file)
Expected: No error. This seems like an acceptable use of os.path.basename
.
I'm happy to lend a hand to resolve this issue, but it is not clear to me how to fix it. Is this an issue with os.path.basename
or map
or something else?