Update mypy to 0.960 (#72481)

pull/72500/head
Marc Mueller 2022-05-25 20:42:14 +02:00 committed by GitHub
parent 2bc093a04d
commit 3c246b7800
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -315,7 +315,7 @@ def _select_unused_attributes_ids(
seen_ids |= { seen_ids |= {
attrs_id[0] attrs_id[0]
for attrs_id in session.execute( for attrs_id in session.execute(
attributes_ids_exist_in_states(*attr_ids) attributes_ids_exist_in_states(*attr_ids) # type: ignore[arg-type]
).all() ).all()
if attrs_id[0] is not None if attrs_id[0] is not None
} }
@ -362,7 +362,7 @@ def _select_unused_event_data_ids(
seen_ids |= { seen_ids |= {
data_id[0] data_id[0]
for data_id in session.execute( for data_id in session.execute(
data_ids_exist_in_events(*data_ids_group) data_ids_exist_in_events(*data_ids_group) # type: ignore[arg-type]
).all() ).all()
if data_id[0] is not None if data_id[0] is not None
} }

View File

@ -62,7 +62,7 @@ def soco_error(
def wrapper(self: _T, *args: _P.args, **kwargs: _P.kwargs) -> _R | None: def wrapper(self: _T, *args: _P.args, **kwargs: _P.kwargs) -> _R | None:
"""Wrap for all soco UPnP exception.""" """Wrap for all soco UPnP exception."""
args_soco = next((arg for arg in args if isinstance(arg, SoCo)), None) # type: ignore[attr-defined] args_soco = next((arg for arg in args if isinstance(arg, SoCo)), None)
try: try:
result = funct(self, *args, **kwargs) result = funct(self, *args, **kwargs)
except (OSError, SoCoException, SoCoUPnPException) as err: except (OSError, SoCoException, SoCoUPnPException) as err:

View File

@ -3,7 +3,7 @@ from __future__ import annotations
import colorsys import colorsys
import math import math
from typing import NamedTuple, cast from typing import NamedTuple
import attr import attr
@ -295,9 +295,9 @@ def color_xy_brightness_to_RGB(
# Apply reverse gamma correction. # Apply reverse gamma correction.
r, g, b = map( r, g, b = map(
lambda x: (12.92 * x) lambda x: (12.92 * x) # type: ignore[no-any-return]
if (x <= 0.0031308) if (x <= 0.0031308)
else ((1.0 + 0.055) * cast(float, pow(x, (1.0 / 2.4))) - 0.055), else ((1.0 + 0.055) * pow(x, (1.0 / 2.4)) - 0.055),
[r, g, b], [r, g, b],
) )

View File

@ -11,7 +11,7 @@ codecov==2.1.12
coverage==6.4 coverage==6.4
freezegun==1.2.1 freezegun==1.2.1
mock-open==1.4.0 mock-open==1.4.0
mypy==0.950 mypy==0.960
pre-commit==2.19.0 pre-commit==2.19.0
pylint==2.13.9 pylint==2.13.9
pipdeptree==2.2.1 pipdeptree==2.2.1