Update Python version used for pylint (#63895)

This commit is contained in:
Marc Mueller 2022-01-11 13:41:57 +01:00 committed by GitHub
parent 277c12cf64
commit f3bc9fc740
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 25 additions and 30 deletions

View file

@ -240,7 +240,6 @@ class HomeAssistant:
def __init__(self) -> None:
"""Initialize new Home Assistant object."""
self.loop = asyncio.get_running_loop()
# pylint: disable-next=unsubscriptable-object
self._pending_tasks: list[asyncio.Future[Any]] = []
self._track_task = True
self.bus = EventBus(self)
@ -363,21 +362,21 @@ class HomeAssistant:
@callback
def async_add_job(
self, target: Callable[..., Awaitable[_R]], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@overload
@callback
def async_add_job(
self, target: Callable[..., Awaitable[_R] | _R], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@overload
@callback
def async_add_job(
self, target: Coroutine[Any, Any, _R], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@callback
@ -385,7 +384,7 @@ class HomeAssistant:
self,
target: Callable[..., Awaitable[_R] | _R] | Coroutine[Any, Any, _R],
*args: Any,
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
"""Add a job to be executed by the event loop or by an executor.
If the job is either a coroutine or decorated with @callback, it will be
@ -409,27 +408,27 @@ class HomeAssistant:
@callback
def async_add_hass_job(
self, hassjob: HassJob[Awaitable[_R]], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@overload
@callback
def async_add_hass_job(
self, hassjob: HassJob[Awaitable[_R] | _R], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@callback
def async_add_hass_job(
self, hassjob: HassJob[Awaitable[_R] | _R], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
"""Add a HassJob from within the event loop.
This method must be run in the event loop.
hassjob: HassJob to call.
args: parameters for method to call.
"""
task: asyncio.Future[_R] # pylint: disable=unsubscriptable-object
task: asyncio.Future[_R]
if hassjob.job_type == HassJobType.Coroutinefunction:
task = self.loop.create_task(
cast(Callable[..., Awaitable[_R]], hassjob.target)(*args)
@ -473,7 +472,7 @@ class HomeAssistant:
@callback
def async_add_executor_job(
self, target: Callable[..., T], *args: Any
) -> asyncio.Future[T]: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[T]:
"""Add an executor job from within the event loop."""
task = self.loop.run_in_executor(None, target, *args)
@ -497,20 +496,20 @@ class HomeAssistant:
@callback
def async_run_hass_job(
self, hassjob: HassJob[Awaitable[_R]], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@overload
@callback
def async_run_hass_job(
self, hassjob: HassJob[Awaitable[_R] | _R], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@callback
def async_run_hass_job(
self, hassjob: HassJob[Awaitable[_R] | _R], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
"""Run a HassJob from within the event loop.
This method must be run in the event loop.
@ -528,21 +527,21 @@ class HomeAssistant:
@callback
def async_run_job(
self, target: Callable[..., Awaitable[_R]], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@overload
@callback
def async_run_job(
self, target: Callable[..., Awaitable[_R] | _R], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@overload
@callback
def async_run_job(
self, target: Coroutine[Any, Any, _R], *args: Any
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
...
@callback
@ -550,7 +549,7 @@ class HomeAssistant:
self,
target: Callable[..., Awaitable[_R] | _R] | Coroutine[Any, Any, _R],
*args: Any,
) -> asyncio.Future[_R] | None: # pylint: disable=unsubscriptable-object
) -> asyncio.Future[_R] | None:
"""Run a job from within the event loop.
This method must be run in the event loop.