mirror of
https://github.com/astral-sh/ruff.git
synced 2025-12-15 21:45:30 +00:00
## Summary Follow-up from #18401, I was looking at whether that would fix the issue at https://github.com/astral-sh/ty/issues/247#issuecomment-2917656676 and it didn't, which made me realize that the PR only inferred `list[T]` when the value type was tuple but it could be other types as well. This PR fixes the actual issue by inferring `list[T]` for the non-tuple type case. ## Test Plan Add test cases for starred expression involved with non-tuple type. I also added a few test cases for list type and list literal. I also verified that the example in the linked issue comment works: ```py def _(line: str): a, b, *c = line.split(maxsplit=2) c.pop() ``` |
||
|---|---|---|
| .. | ||
| mdtest | ||
| primer | ||
| README.md | ||
Markdown files within the mdtest/ subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs integration test.
See crates/ty_test/README.md for documentation of this test format.