Fix pylint plugin for tuple[float, float] returns (#90047)

This commit is contained in:
epenet 2023-03-26 19:54:21 +02:00 committed by GitHub
parent 3b83340f6e
commit c075dac916
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -2796,7 +2796,7 @@ def _is_valid_type(
_is_valid_type(match.group(1), node.value)
and isinstance(node.slice, nodes.Tuple)
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))
)
)

View File

@ -776,7 +776,7 @@ def test_valid_long_tuple(
# Set ignore option
type_hint_checker.config.ignore_missing_annotations = False
class_node, _, _ = astroid.extract_node(
class_node, _, _, _ = astroid.extract_node(
"""
class Entity():
pass
@ -790,6 +790,12 @@ def test_valid_long_tuple(
class TestLight( #@
LightEntity
):
@property
def hs_color( #@
self
) -> tuple[int, int]:
pass
@property
def rgbw_color( #@
self