Closed
Description
Python 3.8
Mypy: 7.6.0
issue type: bug
ffrom functools import singledispatch
@singledispatch
def f(arg) -> str:
pass
@f.register
def _1(arg: int) -> int:
return arg
@f.register
def _2(arg: list) -> list:
return list(map(f, arg))
reveal_type(f(1))
Here's the code in the mypy playground
What is the actual behavior/output?
main.py:15: note: Revealed type is 'builtins.str*'
What is the behavior/output you expect?
main.py:15: note: Revealed type is 'builtins.int*'
Metadata
Metadata
Assignees
Labels
No labels