[ty] Pass unmapped type variables to SpecializationBuilder::build_with#24809
Merged
ibraheemdev merged 1 commit intomainfrom Apr 26, 2026
Merged
[ty] Pass unmapped type variables to SpecializationBuilder::build_with#24809ibraheemdev merged 1 commit intomainfrom
SpecializationBuilder::build_with#24809ibraheemdev merged 1 commit intomainfrom
Conversation
ibraheemdev
commented
Apr 23, 2026
| BoundTypeVarInstance<'db>, | ||
| Option<(Type<'db>, Type<'db>)>, | ||
| ) -> Option<Type<'db>>, | ||
| ) -> Specialization<'db> { |
Member
Author
There was a problem hiding this comment.
@dcreager I believe this should be forwards compatible with the planned changes to SpecializationBuilder because this hook runs after the creation of the constraint set, and hopefully just means more places can use SpecializationBuilder?
Member
There was a problem hiding this comment.
Talked about this in person, and I think I agree that it is forwards compatiable
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 87.94%. The percentage of expected errors that received a diagnostic held steady at 83.36%. The number of fully passing files held steady at 79/133. |
Memory usage reportSummary
Significant changesClick to expand detailed breakdownsphinx
trio
flake8
prefect
|
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-assignment |
1 | 0 | 1 |
invalid-return-type |
0 | 0 | 1 |
no-matching-overload |
1 | 0 | 0 |
unresolved-attribute |
0 | 1 | 0 |
unsupported-operator |
0 | 1 | 0 |
| Total | 2 | 2 | 2 |
Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.
Raw diff:
core (https://github.com/home-assistant/core)
- homeassistant/components/tado/climate.py:812:20 error[unsupported-operator] Operator `in` is not supported between objects of type `str | None` and `str | list[Unknown]`
meson (https://github.com/mesonbuild/meson)
- mesonbuild/backend/ninjabackend.py:1949:81 error[unresolved-attribute] Attribute `startswith` is not defined on `None` in union `str | None`
- mesonbuild/backend/ninjabackend.py:1950:34 error[invalid-assignment] Object of type `str` is not assignable to `Literal["2015", "2018", "2021"]`
+ mesonbuild/backend/ninjabackend.py:1950:34 error[invalid-assignment] Object of type `str | UnspecializedTypeVar` is not assignable to `Literal["2015", "2018", "2021"]`
pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/emu/emulator.py:551:36 error[invalid-assignment] Object of type `tuple[_T@filter, ...]` is not assignable to `tuple[str]`
+ pwndbg/emu/emulator.py:551:42 error[no-matching-overload] No overload of constructor `filter.__new__` matches arguments
werkzeug (https://github.com/pallets/werkzeug)
- src/werkzeug/datastructures/structures.py:532:16 error[invalid-return-type] Return type does not match returned value: expected `list[V@MultiDict]`, found `V@MultiDict | list[V@MultiDict]`
+ src/werkzeug/datastructures/structures.py:532:16 error[invalid-return-type] Return type does not match returned value: expected `list[V@MultiDict]`, found `V@MultiDict | list[Unknown]`
dcreager
approved these changes
Apr 23, 2026
| BoundTypeVarInstance<'db>, | ||
| Option<(Type<'db>, Type<'db>)>, | ||
| ) -> Option<Type<'db>>, | ||
| ) -> Specialization<'db> { |
Member
There was a problem hiding this comment.
Talked about this in person, and I think I agree that it is forwards compatiable
carljm
added a commit
to tamird/ruff
that referenced
this pull request
Apr 27, 2026
* main: (248 commits) [ty] bump conformance suite commit (astral-sh#24848) [ty] Pass unmapped type variables to `SpecializationBuilder::build_with` (astral-sh#24809) [ty] Avoid bookkeeping for unannotated functions (astral-sh#24842) [ty] Optimize signature checking based on number of arguments (astral-sh#24674) [ty] Avoid eagerly inferring legacy generic context (astral-sh#24841) [ty] Skip decorator inference for undecorated functions (astral-sh#24839) [ty] solve unions against generic protocols (astral-sh#24837) [ty] Lazily allocate parameter type builders (astral-sh#24838) [ty] Lazily compute call argument fallbacks (astral-sh#24836) [ty] Avoid collecting type context callables (astral-sh#24835) Bump ecosystem-analyzer to e7576e6 (astral-sh#24834) [ty] Support basic narrowing with aliased conditional expressions (astral-sh#24302) [ty] Fix project and workspace selection (astral-sh#24824) [ty] Fix missing memory usage attributes (astral-sh#24823) Fix setting selection for multi folder workspace (astral-sh#24819) Improve diagnostics for implicit calls to a possibly unbound unary operator. (astral-sh#24816) [ty] Update review pool (astral-sh#24818) Bump 0.15.12 (astral-sh#24815) [ty] Complete support for more detailed diagnostics on possibly unbound errors from implicit dunder calls against unions. (astral-sh#24676) Implement `#ruff:file-ignore` file-level suppressions (astral-sh#23599) ...
carljm
added a commit
that referenced
this pull request
Apr 27, 2026
* main: (44 commits) Update cargo-bins/cargo-binstall action to v1.18.1 (#24855) Update dependency ruff to v0.15.12 (#24857) Update taiki-e/install-action action to v2.75.18 (#24864) [ty] Model bool-op branch snapshots (#24458) [ty] Support `Unpack[TypedDict]` in `**kwargs` signatures (#24653) Update prek dependencies (#24858) Update Rust crate bitflags to v2.11.1 (#24859) Update Rust crate clap to v4.6.1 (#24860) Update Rust crate mimalloc to v0.1.49 (#24862) Update Rust crate uuid to v1.23.1 (#24863) Update Rust crate rayon to v1.12.0 (#24866) Update Rust crate libc to v0.2.185 (#24861) [ty] Reserve union element storage (#24849) [ty] bump conformance suite commit (#24848) [ty] Pass unmapped type variables to `SpecializationBuilder::build_with` (#24809) [ty] Avoid bookkeeping for unannotated functions (#24842) [ty] Optimize signature checking based on number of arguments (#24674) [ty] Avoid eagerly inferring legacy generic context (#24841) [ty] Skip decorator inference for undecorated functions (#24839) [ty] solve unions against generic protocols (#24837) ...
This was referenced Apr 27, 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.
This is a small refactor, and means that we no longer have to manually compute the constraint set solutions just to change the default specialization of a given mapping.