Closed
Description
Thanks for all the work with mypy. I'm really enjoying it every time I code now.
I found this oddity which may be a bug.
Here is a short demo.
from typing import Tuple
def demo() -> Tuple[str, ...]:
matches = [('a', 'b')]
return matches[0] if matches else tuple()
# demo.py:6: error: Incompatible return value type (got "object", expected "Tuple[str, ...]")
def noerror() -> Tuple[str, ...]:
matches = [('a', 'b')]
if matches:
return matches[0]
else:
return tuple()
Metadata
Metadata
Assignees
Labels
No labels