mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Update Python version for mypy to 3.13 (#135636)
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
"""Helpers for config validation using voluptuous."""
|
||||
|
||||
# PEP 563 seems to break typing.get_type_hints when used
|
||||
# with PEP 695 syntax. Fixed in Python 3.13.
|
||||
# from __future__ import annotations
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable, Hashable, Mapping
|
||||
import contextlib
|
||||
@ -354,7 +352,7 @@ def ensure_list[_T](value: _T | None) -> list[_T] | list[Any]:
|
||||
"""Wrap value in list if it is not one."""
|
||||
if value is None:
|
||||
return []
|
||||
return cast("list[_T]", value) if isinstance(value, list) else [value]
|
||||
return cast(list[_T], value) if isinstance(value, list) else [value]
|
||||
|
||||
|
||||
def entity_id(value: Any) -> str:
|
||||
|
Reference in New Issue
Block a user