Update mypy-dev to 1.14.0a5 (#132063)

This commit is contained in:
Marc Mueller 2024-12-02 14:40:13 +01:00 committed by GitHub
parent 89ee49e50c
commit fe0f414e99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 4 deletions

View File

@ -60,5 +60,5 @@ class RenaultDataEntity(
def _get_data_attr(self, key: str) -> StateType:
"""Return the attribute value from the coordinator data."""
if self.coordinator.data is None:
return None # type: ignore[unreachable]
return None
return cast(StateType, getattr(self.coordinator.data, key))

View File

@ -23,7 +23,16 @@ import statistics
from struct import error as StructError, pack, unpack_from
import sys
from types import CodeType, TracebackType
from typing import Any, Concatenate, Literal, NoReturn, Self, cast, overload
from typing import (
TYPE_CHECKING,
Any,
Concatenate,
Literal,
NoReturn,
Self,
cast,
overload,
)
from urllib.parse import urlencode as urllib_urlencode
import weakref
@ -88,6 +97,9 @@ from .singleton import singleton
from .translation import async_translate_state
from .typing import TemplateVarsType
if TYPE_CHECKING:
from _typeshed import OptExcInfo
# mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
@ -532,7 +544,7 @@ class Template:
self._compiled: jinja2.Template | None = None
self.hass = hass
self.is_static = not is_template_string(template)
self._exc_info: sys._OptExcInfo | None = None
self._exc_info: OptExcInfo | None = None
self._limited: bool | None = None
self._strict: bool | None = None
self._log_fn: Callable[[int, str], None] | None = None

View File

@ -12,7 +12,7 @@ coverage==7.6.8
freezegun==1.5.1
license-expression==30.4.0
mock-open==1.4.0
mypy-dev==1.14.0a3
mypy-dev==1.14.0a5
pre-commit==4.0.0
pydantic==1.10.19
pylint==3.3.1