Skip to content

[ty] Support narrowing for extended walrus targets#24129

Merged
carljm merged 6 commits intomainfrom
charlie/wal-narrow
Mar 24, 2026
Merged

[ty] Support narrowing for extended walrus targets#24129
carljm merged 6 commits intomainfrom
charlie/wal-narrow

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

Closes astral-sh/ty#3103.

@astral-sh-bot astral-sh-bot bot added the ty Multi-file analysis & type inference label Mar 23, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 23, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 85.38%. The percentage of expected errors that received a diagnostic held steady at 78.70%. The number of fully passing files held steady at 64/132.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 23, 2026

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 23, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
unresolved-attribute 0 2 0
invalid-argument-type 0 1 0
not-iterable 0 1 0
Total 0 4 0

Raw diff:

rotki (https://github.com/rotki/rotki)
- rotkehlchen/api/v1/schemas.py:349:14 error[unresolved-attribute] Attribute `is_evm_or_evmlike` is not defined on `None` in union `SupportedBlockchain | None`
- rotkehlchen/api/v1/schemas.py:350:14 error[unresolved-attribute] Attribute `is_substrate` is not defined on `None` in union `SupportedBlockchain | None`
- rotkehlchen/api/v1/schemas.py:355:43 error[invalid-argument-type] Argument to function `is_valid_bitcoin_address` is incorrect: Expected `SupportedBlockchain`, found `SupportedBlockchain | None`
- rotkehlchen/history/price.py:230:37 error[not-iterable] Object of type `list[UnderlyingToken] | None` may not be iterable

Full report with detailed diff (timing results)

@charliermarsh charliermarsh marked this pull request as ready for review March 23, 2026 01:04
@carljm carljm assigned carljm and unassigned dcreager Mar 23, 2026
Copy link
Copy Markdown
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were some bugs here where prior narrowing state didn't get cleared correctly; required some re-ordering of operations in the semantic index builder to avoid that.

@carljm carljm merged commit 523fcf9 into main Mar 24, 2026
49 checks passed
@carljm carljm deleted the charlie/wal-narrow branch March 24, 2026 01:23
carljm added a commit that referenced this pull request Mar 25, 2026
* main:
  [ty] Avoid eager TypedDict diagnostics in `TypedDict | dict` unions (#24151)
  `F507`: Fix false negative for non-tuple RHS in `%`-formatting (#24142)
  [ty] Update `SpecializationBuilder` hook to get both lower/upper bounds (#23848)
  Fix `%foo?` parsing in IPython assignment expressions (#24152)
  `E501`/`W505`/formatter: Exclude nested pragma comments from line width calculation  (#24071)
  [ty] Fix Salsa panic propagation (#24141)
  [ty] Support `type:ignore[ty:code]` suppressions (#24096)
  [ty] Support narrowing for extended walrus targets (#24129)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-None type inference doesn't work with walrus operator

3 participants