ruff
a804c906 - [ty] Infer generic elements from gradual tuples (#28637)

Commit
31 days ago
[ty] Infer generic elements from gradual tuples (#28637) A gradual tuple `tuple[Any, ...]` is assumed to materialize to the correct length when assigned to a fixed-length tuple, and the gradual element type should contribute to generic inference instead of falling back to `Unknown`. ```py from typing import Any def _(values: list[tuple[Any, ...]]): reveal_type(dict(values)) # main: dict[Unknown, Unknown], now: dict[Any, Any] ``` Follow up to https://github.com/astral-sh/ruff/pull/28588.
Author
Parents
Loading