astral-sh
ruff
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
[ty] default-specialize class-literal types in assignment to generic-alias types
cjm/unspecassign
13 minutes ago
add more comments
dcreager/callable-return
50 minutes ago
Merge remote-tracking branch 'origin/main' into dcreager/callable-return * origin/main: (33 commits) [ty] Simplify union lower bounds and intersection upper bounds in constraint sets (#21871) [ty] Collapse `never` paths in constraint set BDDs (#21880) Fix leading comment formatting for lambdas with multiple parameters (#21879) [ty] Type inference for `@asynccontextmanager` (#21876) Fix comment placement in lambda parameters (#21868) [`pylint`] Detect subclasses of builtin exceptions (`PLW0133`) (#21382) Fix stack overflow with recursive generic protocols (depth limit) (#21858) New diagnostics for unused range suppressions (#21783) [ty] Use default settings in completion tests [ty] Infer type variables within generic unions (#21862) [ty] Fix overload filtering to prefer more "precise" match (#21859) [ty] Stabilize auto-import [ty] Fix reveal-type E2E test (#21865) [ty] Use concise message for LSP clients not supporting related diagnostic information (#21850) Include more details in Tokens 'offset is inside token' panic message (#21860) apply range suppressions to filter diagnostics (#21623) [ty] followup: add-import action for `reveal_type` too (#21668) [ty] Enrich function argument auto-complete suggestions with annotated types [ty] Add autocomplete suggestions for function arguments [`flake8-bugbear`] Accept immutable slice default arguments (`B008`) (#21823) ...
dcreager/callable-return
1 hour ago
[ty] Simplify union lower bounds and intersection upper bounds in constraint sets (#21871) In a constraint set, it's not useful for an upper bound to be an intersection type, or for a lower bound to be a union type. Both of those can be rewritten as simpler BDDs: ``` T ≤ α & β ⇒ (T ≤ α) ∧ (T ≤ β) T ≤ α & ¬β ⇒ (T ≤ α) ∧ ¬(T ≤ β) α | β ≤ T ⇒ (α ≤ T) ∧ (β ≤ T) ``` We were seeing performance issues on #21551 when _not_ performing this simplification. For instance, `pandas` was producing some constraint sets involving intersections of 8-9 different types. Our sequent map calculation was timing out calculating all of the different permutations of those types: ``` t1 & t2 & t3 → t1 t1 & t2 & t3 → t2 t1 & t2 & t3 → t3 t1 & t2 & t3 → t1 & t2 t1 & t2 & t3 → t1 & t3 t1 & t2 & t3 → t2 & t3 ``` (and then imagine what that looks like for 9 types instead of 3...) With this change, all of those permutations are now encoded in the BDD structure itself, which is very good at simplifying that kind of thing. Pulling this out of #21551 for separate review.
main
2 hours ago
describe CannotSimplify results
dcreager/die-die-intersections
3 hours ago
[ty] Collapse `never` paths in constraint set BDDs (#21880) #21744 fixed some non-determinism in our constraint set implementation by switching our BDD representation from being "fully reduced" to being "quasi-reduced". We still deduplicate identical nodes (via salsa interning), but we removed the logic to prune redundant nodes (one with identical outgoing true and false edges). This ensures that the BDD "remembers" all of the individual constraints that it was created with. However, that comes at the cost of creating larger BDDs, and on #21551 that was causing performance issues. `scikit-learn` was producing a function signature with dozens of overloads, and we were trying to create a constraint set that would map a return type typevar to any of those overload's return types. This created a combinatorial explosion in the BDD, with by far most of the BDD paths leading to the `never` terminal. This change updates the quasi-reduction logic to prune nodes that are redundant _because both edges lead to the `never` terminal_. In this case, we don't need to "remember" that constraint, since no assignment to it can lead to a valid specialization. So we keep the "memory" of our quasi-reduced structure, while still pruning large unneeded portions of the BDD structure. Pulling this out of https://github.com/astral-sh/ruff/pull/21551 for separate review.
main
3 hours ago
Merge branch 'main' into brent/indent-lambda-params
brent/indent-lambda-params
3 hours ago
bump dependencies to pull in Salsa support for `ordermap`
order_map
3 hours ago
Active Branches
[ty] default-specialize class-literal types in assignment to generic-alias types
last run
13 minutes ago
#21883
CodSpeed Performance Gauge
0%
[ty] Infer typevar specializations for `Callable` types
last run
50 minutes ago
#21551
CodSpeed Performance Gauge
-15%
Keep lambda parameters on one line and parenthesize the body if it expands
last run
3 hours ago
#21385
CodSpeed Performance Gauge
0%
© 2025 CodSpeed Technology
Home
Terms
Privacy
Docs