Use PEP 695 for function annotations with scoping (#117787)
This commit is contained in:
parent
f50973c76c
commit
7998f874c0
5 changed files with 14 additions and 23 deletions
|
@ -6,16 +6,13 @@ from collections.abc import Awaitable, Callable, Coroutine
|
|||
from functools import wraps
|
||||
from http import HTTPStatus
|
||||
import logging
|
||||
from typing import Any, Concatenate, ParamSpec, TypeVar
|
||||
from typing import Any, Concatenate
|
||||
|
||||
from aiohttp import web
|
||||
import voluptuous as vol
|
||||
|
||||
from .view import HomeAssistantView
|
||||
|
||||
_HassViewT = TypeVar("_HassViewT", bound=HomeAssistantView)
|
||||
_P = ParamSpec("_P")
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -36,7 +33,7 @@ class RequestDataValidator:
|
|||
self._schema = schema
|
||||
self._allow_empty = allow_empty
|
||||
|
||||
def __call__(
|
||||
def __call__[_HassViewT: HomeAssistantView, **_P](
|
||||
self,
|
||||
method: Callable[
|
||||
Concatenate[_HassViewT, web.Request, dict[str, Any], _P],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue