[ty] Preserve unpacking diagnostics for nested assignment targets#26121
Merged
charliermarsh merged 3 commits intoJun 18, 2026
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 94.37%. The percentage of expected errors that received a diagnostic held steady at 89.00%. The number of fully passing files held steady at 94/134. |
Memory usage reportSummary
Significant changesClick to expand detailed breakdownprefect
sphinx
trio
flake8
|
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
unresolved-attribute |
14 | 0 | 0 |
not-iterable |
2 | 0 | 0 |
possibly-unresolved-reference |
2 | 0 | 0 |
| Total | 18 | 0 | 0 |
Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.
Raw diff (18 changes)
dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/vendor/ply/lex.py:331:23 error[unresolved-attribute] Unresolved attribute `type` on type `LexToken`
hydpy (https://github.com/hydpy-dev/hydpy)
+ hydpy/core/testtools.py:3131:5 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3131:16 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3131:27 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3131:38 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3131:49 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3132:5 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3132:15 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3132:25 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3133:5 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3133:15 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3133:25 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
ignite (https://github.com/pytorch/ignite)
+ examples/reinforcement_learning/actor_critic.py:153:9 error[unresolved-attribute] Unresolved attribute `observation` on type `State`
+ examples/reinforcement_learning/reinforce.py:95:9 error[unresolved-attribute] Unresolved attribute `observation` on type `State`
pywin32 (https://github.com/mhammond/pywin32)
+ win32/Lib/sspi.py:173:54 error[not-iterable] Object of type `None` is not iterable
scikit-learn (https://github.com/scikit-learn/scikit-learn)
+ sklearn/linear_model/_least_angle.py:692:17 warning[possibly-unresolved-reference] Name `C_idx` used when possibly not defined
+ sklearn/linear_model/_least_angle.py:742:21 warning[possibly-unresolved-reference] Name `C_idx` used when possibly not defined
yarl (https://github.com/aio-libs/yarl)
+ yarl/_url.py:608:79 error[not-iterable] Object of type `None` is not iterable
charliermarsh
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Now that we have a statement-level inference query, we can simplify the handling of assignment unpacking and close some diagnostic gaps. We no longer need an
UnpackPositionto avoid duplicate diagnostics, since the statement-level query always owns the assignment unpacking. We do need to track unpacking expressions by assignment target in the semantic index, and reuse that unpacking metadata during type inference so nested targets still emit unpacking diagnostics.Closes astral-sh/ty#3801
Testing
Added mdtest and updated some expectations.