Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(🐞) [1.15 REGRESSION] tuple fallback reports any expression #18770

Open
KotlinIsland opened this issue Mar 8, 2025 · 1 comment
Open

(🐞) [1.15 REGRESSION] tuple fallback reports any expression #18770

KotlinIsland opened this issue Mar 8, 2025 · 1 comment
Labels
bug mypy got something wrong topic-disallow-any The disallow-any-* family of flags

Comments

@KotlinIsland
Copy link
Contributor

KotlinIsland commented Mar 8, 2025

# mypy: allow-any-expr=False
a: tuple[int, int]
print(a[:]) # Expression type contains "Any" (has type "tuple[int, int]")  [misc]

playground

@KotlinIsland KotlinIsland added the bug mypy got something wrong label Mar 8, 2025
@sterliakov
Copy link
Collaborator

Exposed by #18585. At some point fallback is constructed as self.named_type("builtins.tuple") (there are several such places) and wrong Any (from_omitted_generics) ends up in slice tuple_fallback.

Minimal repro:

a: tuple[int, int]
print(a[:])

@sterliakov sterliakov added the topic-disallow-any The disallow-any-* family of flags label Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-disallow-any The disallow-any-* family of flags
Projects
None yet
Development

No branches or pull requests

2 participants