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

View File

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