Upgrade mypy to 0.711, drop no longer needed workarounds (#24998)

https://mypy-lang.blogspot.com/2019/06/mypy-0711-released.html
This commit is contained in:
Ville Skyttä 2019-07-07 04:58:33 +03:00 committed by Martin Hjelmare
parent b274b10f38
commit e8a5306c23
5 changed files with 9 additions and 13 deletions

View File

@ -257,8 +257,7 @@ class ConfigEntry:
self.title, self.domain)
return False
# Handler may be a partial
# type ignore: https://github.com/python/typeshed/pull/3077
while isinstance(handler, functools.partial): # type: ignore
while isinstance(handler, functools.partial):
handler = handler.func
if self.version == handler.VERSION:

View File

@ -270,9 +270,8 @@ class HomeAssistant:
# Check for partials to properly determine if coroutine function
check_target = target
# type ignores: https://github.com/python/typeshed/pull/3077
while isinstance(check_target, functools.partial): # type: ignore
check_target = check_target.func # type: ignore
while isinstance(check_target, functools.partial):
check_target = check_target.func
if asyncio.iscoroutine(check_target):
task = self.loop.create_task(target) # type: ignore
@ -947,9 +946,8 @@ class Service:
self.func = func
self.schema = schema
# Properly detect wrapped functions
# type ignores: https://github.com/python/typeshed/pull/3077
while isinstance(func, functools.partial): # type: ignore
func = func.func # type: ignore
while isinstance(func, functools.partial):
func = func.func
self.is_callback = is_callback(func)
self.is_coroutinefunction = asyncio.iscoroutinefunction(func)

View File

@ -141,9 +141,8 @@ def catch_log_exception(
# Check for partials to properly determine if coroutine function
check_func = func
# type ignores: https://github.com/python/typeshed/pull/3077
while isinstance(check_func, partial): # type: ignore
check_func = check_func.func # type: ignore
while isinstance(check_func, partial):
check_func = check_func.func
wrapper_func = None
if asyncio.iscoroutinefunction(check_func):

View File

@ -7,7 +7,7 @@ coveralls==1.2.0
flake8-docstrings==1.3.0
flake8==3.7.7
mock-open==1.3.1
mypy==0.710
mypy==0.711
pydocstyle==3.0.0
pylint==2.3.1
pytest-aiohttp==0.3.0

View File

@ -8,7 +8,7 @@ coveralls==1.2.0
flake8-docstrings==1.3.0
flake8==3.7.7
mock-open==1.3.1
mypy==0.710
mypy==0.711
pydocstyle==3.0.0
pylint==2.3.1
pytest-aiohttp==0.3.0