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:
parent
216944b3cd
commit
248e48dc30
2 changed files with 11 additions and 4 deletions
|
@ -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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue