[mypy] Fix wrong type annotations related to tuple (#25660)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-09-25 21:00:45 +08:00
committed by GitHub
parent 1e9a77e037
commit 2f17117606
9 changed files with 25 additions and 20 deletions

View File

@@ -50,8 +50,11 @@ def test_is_type(type_hint, type, expected):
@pytest.mark.parametrize(("type_hints", "type", "expected"), [
({float, int}, int, True),
({int, tuple}, int, True),
({int, tuple[int]}, int, True),
({int, tuple[int, ...]}, int, True),
({int, tuple[int]}, float, False),
({int, tuple[int, ...]}, float, False),
({str, Literal["x", "y"]}, Literal, True),
])
def test_contains_type(type_hints, type, expected):