core: improve types for warn_if_empty

ok, works with this advice https://github.com/python/mypy/issues/1927 + overloads
This commit is contained in:
Dima Gerasimov 2020-05-25 01:23:30 +01:00
parent 216944b3cd
commit 248e48dc30
2 changed files with 11 additions and 4 deletions

View file

@ -60,7 +60,7 @@ def test_warn_if_empty() -> None:
yield 'aba'
@warn_if_empty
def empty() -> List[str]:
def empty() -> List[int]:
return []
# should be rejected by mypy!