mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Fix pylint plugin for tuple[float, float] returns (#90047)
This commit is contained in:
parent
3b83340f6e
commit
c075dac916
@ -2796,7 +2796,7 @@ def _is_valid_type(
|
|||||||
_is_valid_type(match.group(1), node.value)
|
_is_valid_type(match.group(1), node.value)
|
||||||
and isinstance(node.slice, nodes.Tuple)
|
and isinstance(node.slice, nodes.Tuple)
|
||||||
and all(
|
and all(
|
||||||
_is_valid_type(match.group(n + 2), node.slice.elts[n])
|
_is_valid_type(match.group(n + 2), node.slice.elts[n], in_return)
|
||||||
for n in range(len(node.slice.elts))
|
for n in range(len(node.slice.elts))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -776,7 +776,7 @@ def test_valid_long_tuple(
|
|||||||
# Set ignore option
|
# Set ignore option
|
||||||
type_hint_checker.config.ignore_missing_annotations = False
|
type_hint_checker.config.ignore_missing_annotations = False
|
||||||
|
|
||||||
class_node, _, _ = astroid.extract_node(
|
class_node, _, _, _ = astroid.extract_node(
|
||||||
"""
|
"""
|
||||||
class Entity():
|
class Entity():
|
||||||
pass
|
pass
|
||||||
@ -790,6 +790,12 @@ def test_valid_long_tuple(
|
|||||||
class TestLight( #@
|
class TestLight( #@
|
||||||
LightEntity
|
LightEntity
|
||||||
):
|
):
|
||||||
|
@property
|
||||||
|
def hs_color( #@
|
||||||
|
self
|
||||||
|
) -> tuple[int, int]:
|
||||||
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rgbw_color( #@
|
def rgbw_color( #@
|
||||||
self
|
self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user