You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As #13316 is merged, there are some follow-up work that needs to be done. The following is a list in the order of priority where the highest priority work is on the top:
Avoiding duplicate diagnostics. Considering (a, b) = (1, 2), as the inference runs for each symbol, if there are any diagnostics that's raised during that part (like "too many values to unpack"), then there will be multiple diagnostics added to the builder one for each symbol. Refer [red-knot] Infer target types for unpacked tuple assignment #13316 (comment)
Use the unpacking logic in other places where it's relevant like for loops, with statements. For example, in for (x, y) in [(1, 2), (3, 4)]: ...
Combine starred element types. For example, in (a, *b, c) = (1, 2, 3, 4), the Literal[2] and Literal[3] type should be combined into list[int] to be assigned to *b. (Requires generic support over list)
As #13316 is merged, there are some follow-up work that needs to be done. The following is a list in the order of priority where the highest priority work is on the top:
(a, b) = (1, 2)
, as the inference runs for each symbol, if there are any diagnostics that's raised during that part (like "too many values to unpack"), then there will be multiple diagnostics added to the builder one for each symbol. Refer [red-knot] Infer target types for unpacked tuple assignment #13316 (comment)for
loops,with
statements. For example, infor (x, y) in [(1, 2), (3, 4)]: ...
(a, *b, c) = (1, 2, 3, 4)
, theLiteral[2]
andLiteral[3]
type should be combined intolist[int]
to be assigned to*b
. (Requires generic support over list)ruff/crates/red_knot_python_semantic/src/types/infer.rs
Lines 1248 to 1251 in c6b311c
The text was updated successfully, but these errors were encountered: