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
$ 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?
The text was updated successfully, but these errors were encountered:
foo.py:13: error: Argument 1 to "foo" has incompatible type "Callable[[_B], _B]"; expected "Callable[[str], _B]"
Found 1 error in 1 file (checked 1 source file)
I believe this is a mypy problem. Could a mypy maintainer move this issue?
In typeshed we could probably work around the problem by adding additional overloads for str and bytes to basename(), but I would obviously prefer this to be solved in mypy.
Minimal code example:
Actual result:
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
ormap
or something else?The text was updated successfully, but these errors were encountered: