-
Notifications
You must be signed in to change notification settings - Fork 139
Closed
astral-sh/ruff
#18897Labels
bugSomething isn't workingSomething isn't workingdiagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.
Milestone
Description
Summary
Consider the following code:
class Foo():
pass
a, b = Foo().nonexistantHere, 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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdiagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.