Adjust targets type hint in notify platform (#90062)

This commit is contained in:
epenet 2023-03-26 19:52:55 +02:00 committed by GitHub
parent a036e31495
commit 3058cc8d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
import asyncio import asyncio
from collections.abc import Callable, Coroutine from collections.abc import Callable, Coroutine, Mapping
from functools import partial from functools import partial
from typing import Any, Protocol, cast from typing import Any, Protocol, cast
@ -221,7 +221,7 @@ class BaseNotificationService:
registered_targets: dict[str, Any] registered_targets: dict[str, Any]
@property @property
def targets(self) -> dict[str, Any] | None: def targets(self) -> Mapping[str, Any] | None:
"""Return a dictionary of registered targets.""" """Return a dictionary of registered targets."""
return None return None

View File

@ -2035,7 +2035,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
matches=[ matches=[
TypeHintMatch( TypeHintMatch(
function_name="targets", function_name="targets",
return_type=["dict[str, Any]", None], return_type=["Mapping[str, Any]", None],
), ),
TypeHintMatch( TypeHintMatch(
function_name="send_message", function_name="send_message",