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
Here, the RHS of the assignment has an error unresolved-attribute which is being shown 3 times (2 + 1 where 2 is the number of variables involved in the unpacking):
This is because the standalone expression is being inferred outside the unpacking in infer_assignment_definition (and similarly in infer_for_statement_definition). This inference should only be done for non-unpack targets.
Fixing this would lead to another bug which is that the diagnostics raised during the unpacking query isn't being merged into the outer type inference builder.
Version
No response
The text was updated successfully, but these errors were encountered:
dhruvmanila
changed the title
[red-knot] Duplicate diagnostics in unpacking assignment
[red-knot] Duplicate diagnostics in unpacking targets
Mar 5, 2025
Summary
Consider the following code:
Here, the RHS of the assignment has an error
unresolved-attribute
which is being shown 3 times (2 + 1 where 2 is the number of variables involved in the unpacking):This is because the standalone expression is being inferred outside the unpacking in
infer_assignment_definition
(and similarly ininfer_for_statement_definition
). This inference should only be done for non-unpack targets.Fixing this would lead to another bug which is that the diagnostics raised during the unpacking query isn't being merged into the outer type inference builder.
Version
No response
The text was updated successfully, but these errors were encountered: