Avatar for the astral-sh user
astral-sh
ruff
BlogDocsChangelog

[ty] infer function's return type

#17371
Comparing
mtshiba:infer-return-type
(
f5e5165
) with
main
(
f619783
)
CodSpeed Performance Gauge
-40%
Regression
4
Untouched
48

Benchmarks

52 total
sympy
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
-40%
52.1 s86.6 s
attrs
crates/ruff_benchmark/benches/ty.rs::project::attrs::project
CodSpeed Performance Gauge
-13%
436.2 ms498.8 ms
pandas
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
-6%
64.8 s68.5 s
freqtrade
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
-5%
8.1 s8.5 s
static_frame
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
21.7 s21.7 s
linter/all-with-preview-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
835.3 µs835.2 µs
linter/all-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
2 ms2 ms
linter/all-with-preview-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
2.3 ms2.2 ms
linter/all-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
731.5 µs731.4 µs
linter/all-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
4.3 ms4.3 ms
linter/all-with-preview-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
22.6 ms22.6 ms
parser[large/dataset.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
5.1 ms5.1 ms
linter/all-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
8.5 ms8.5 ms
linter/default-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
CodSpeed Performance Gauge
0%
209.5 µs209.5 µs
parser[pydantic/types.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
2 ms2 ms
linter/all-with-preview-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
10.2 ms10.2 ms
linter/all-with-preview-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
5.2 ms5.2 ms
parser[unicode/pypinyin.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
328.7 µs328.7 µs
linter/all-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
18.5 ms18.5 ms
parser[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
946.3 µs946.2 µs
parser[numpy/globals.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
108.5 µs108.5 µs
lexer[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
CodSpeed Performance Gauge
0%
227.9 µs227.9 µs
lexer[unicode/pypinyin.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
CodSpeed Performance Gauge
0%
79 µs79 µs
lexer[numpy/globals.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
CodSpeed Performance Gauge
0%
30.2 µs30.2 µs
lexer[large/dataset.py]
crates/ruff_benchmark/benches/lexer.rs::lexer::benchmark_lexer
CodSpeed Performance Gauge
0%
1.2 ms1.2 ms

Commits

Click on a commit to change the comparison range
Base
main
f619783
+0.01%
infer recursive function's return type
391ee91
11 months ago
by mtshiba
-0.04%
Merge remote-tracking branch 'upstream/main' into infer-return-type
b9bca33
10 months ago
by mtshiba
+0.11%
Apply suggestions from code review
8745f3a
10 months ago
by mtshiba
-0.05%
Merge remote-tracking branch 'upstream/main' into infer-return-type
418f7ee
10 months ago
by mtshiba
-0.04%
Merge remote-tracking branch 'upstream/main' into infer-return-type
b5824aa
10 months ago
by mtshiba
0%
fix according to the review comments
2c0cbb4
10 months ago
by mtshiba
-5.33%
Merge remote-tracking branch 'upstream/main' into infer-return-type
005dde5
10 months ago
by mtshiba
-0.02%
refactor: `inferred_return_ty` -> `infer_return_type`
4d611d9
10 months ago
by mtshiba
+0.84%
Infer return types of (non-final) methods according to MRO
94201b6
10 months ago
by mtshiba
-0.57%
Use `callable_type` to get the return type instead of passing a closure
7f7c230
10 months ago
by mtshiba
-1.13%
Update types.rs
2c534c6
10 months ago
by mtshiba
+1.66%
Merge remote-tracking branch 'upstream/main' into infer-return-type
db63237
9 months ago
by mtshiba
-3.52%
Add `CallStack` to prevent divergence in type inference for recursive functions
c0f218e
9 months ago
by mtshiba
+1.22%
make `TupleType::to_class_type` a tracked function
f17a650
9 months ago
by mtshiba
-42.18%
increase `max_diagnostics` in `sympy`
4f0ce11
9 months ago
by mtshiba
+3.09%
move `scipy` to `good.txt` and `manticore` to `bad.txt`
9bc45f8
8 months ago
by mtshiba
+0.57%
move `ScopeInference::returnees` to `ScopeInferenceExtra`
1e1993f
8 months ago
by mtshiba
-0.68%
Update type.md
e275162
8 months ago
by mtshiba
+1.04%
Avoid unspecialized type variables appearing in the return type
46d21df
8 months ago
by mtshiba
+40.73%
Update ty_check_invalid_syntax.rs
38fcc41
8 months ago
by mtshiba
-1.95%
Update infer.rs
d108854
7 months ago
by mtshiba
-0.11%
fix for fuzzer-reported panic
83cd6ae
7 months ago
by mtshiba
+0.67%
use `CycleDetector` with `has_divergent_type()`
c7eeffc
7 months ago
by mtshiba
-0.48%
fix `union_add` bug
3c0034f
7 months ago
by mtshiba
-29.97%
increase max number of `pandas` diagnostics
0bc75d4
7 months ago
by mtshiba
+1.45%
No type normalization in `infer_return_type`
90ec05e
7 months ago
by mtshiba
-0.6%
move `sympy` to `good.txt`
6581f3b
7 months ago
by mtshiba
-3.43%
The return type of a generator function is `Unknown` for now
f6418a6
7 months ago
by mtshiba
+1.83%
Update types.rs
acb9118
7 months ago
by mtshiba
-1.6%
add doc comments
9b1c373
7 months ago
by mtshiba
-1.32%
Add unit tests for the `Divergent` type
2d1b8a3
7 months ago
by mtshiba
+3.46%
remove `divergence_safe_{todo, unknown}`
a67b434
7 months ago
by mtshiba
+1.53%
remove `function_place`
bf4c1f1
7 months ago
by mtshiba
+0.15%
simply call the tracked function instead of using `LazyCell`
5f38dcb
7 months ago
by mtshiba
-5.02%
Revert "revert an unnecessary change"
7326e47
7 months ago
by mtshiba
+4.84%
remove `ScopeInference::scope`
9739daa
7 months ago
by mtshiba
+0.3%
revert changes in `narrow.rs`
866e567
7 months ago
by mtshiba
-0.5%
`ScopeInference::cycle_fallback() == Divergent`
a1bd758
7 months ago
by mtshiba
+0.61%
remove special casing of `Divergent` in union/intersection reduction
3c9703d
7 months ago
by mtshiba
+0.63%
Revert "remove special casing of `Divergent` in union/intersection reduction"
7e418a7
7 months ago
by mtshiba
+2.4%
Merge branch 'main' into infer-return-type
eb4b078
7 months ago
by mtshiba
+26.61%
`DivergentType` has a `ScopeId`
e1a4654
7 months ago
by mtshiba
-26.01%
refactor
2197085
7 months ago
by mtshiba
-1.99%
clarify that the inferred return type is not exposed in the signature
8da9e9b
7 months ago
by mtshiba
+1.66%
Merge branch 'main' into infer-return-type
1d0c044
7 months ago
by mtshiba
-1.49%
remove unnecessary changes
164af9e
7 months ago
by mtshiba
+2.53%
Update return_type.md
4f68d19
7 months ago
by mtshiba
+25.25%
Update crates/ty_python_semantic/resources/mdtest/function/return_type.md
fe252a0
7 months ago
by mtshiba
-25.44%
Update return_type.md
c76c0f8
7 months ago
by mtshiba
-0.73%
Update return_type.md
312d97a
7 months ago
by mtshiba
+2.17%
Merge branch 'main' into infer-return-type
e47baf5
7 months ago
by mtshiba
-5.28%
Merge branch 'main' into infer-return-type
fde305f
7 months ago
by mtshiba
-0.02%
remove the `debug_assertions` attributes
35ffbfc
7 months ago
by mtshiba
-0.23%
do nothing except normalization of recursive types when `visitor.is_recursive()`
23e0cfe
7 months ago
by mtshiba
-0.65%
Merge branch 'main' into infer-return-type
edad752
7 months ago
by mtshiba
-8.77%
union the previous cycle type in `implicit_attribute`
74af681
7 months ago
by mtshiba
-0.92%
Add `PossiblyRecursive{Scope, Definition, Expression}`
2a73060
7 months ago
by mtshiba
-1.65%
experiment: `DivergentType::scope: ScopeId -> file: File, file_scope: FileScopeId`
3602296
7 months ago
by mtshiba
+4.61%
Revert "experiment: `DivergentType::scope: ScopeId -> file: File, file_scope: FileScopeId`"
48aea8a
7 months ago
by mtshiba
-7.77%
proper cycle recovery handling for `infer_expression_types`
b7fa61b
7 months ago
by mtshiba
-12.59%
Merge branch 'main' into infer-return-type
dfc71f4
7 months ago
by mtshiba
+0.12%
Revert "use `any_over_type` in `has_divergent_type`"
a26d6c6
7 months ago
by mtshiba
-0.03%
separate `NormalizedVisitor` and `RecursiveTypeNormalizedVisitor`
c210b75
7 months ago
by mtshiba
-2.21%
Merge branch 'main' into infer-return-type
c61b33c
7 months ago
by mtshiba
-0.02%
Update infer.rs
caf5691
7 months ago
by mtshiba
+0.05%
Update type.md
43d306b
7 months ago
by mtshiba
0%
Update return_type.md
a778047
7 months ago
by mtshiba
-0.17%
Merge branch 'main' into infer-return-type
6419669
6 months ago
by mtshiba
+24.58%
Update types.rs
0132164
6 months ago
by mtshiba
+4.86%
use `any_over_type` in `has_divergent_type`
c58434d
6 months ago
by mtshiba
+34.89%
revert unnecessary changes for the purpose of this PR
112599f
6 months ago
by mtshiba
-34.4%
use `CycleRecoveryAction::Fallback` even within `infer_scope_types`
0e63890
6 months ago
by mtshiba
+0.89%
Merge branch 'main' into infer-return-type
90d770b
6 months ago
by mtshiba
+0.7%
Update ty_walltime.rs
706eff8
6 months ago
by mtshiba
+32.87%
Merge branch 'main' into infer-return-type
39a528e
4 months ago
by mtshiba
-0.15%
revert unnecessary changes
505dcc8
4 months ago
by mtshiba
-0.08%
Merge branch 'main' into infer-return-type
edb970c
4 months ago
by mtshiba
-13.13%
increase max_diagnostics
c5bd2cd
4 months ago
by mtshiba
+0.37%
fix `Type::cycle_normalized`
1d1afaa
4 months ago
by mtshiba
-27.58%
Update ty_walltime.rs
7093727
4 months ago
by mtshiba
-6.32%
add `IntersectionBuilder::intersection_hashes`
af8b75b
4 months ago
by mtshiba
+6.01%
Revert "add `IntersectionBuilder::intersection_hashes`"
bbad56b
4 months ago
by mtshiba
-0.35%
simply filter `InnerIntersectionBuilder`s using equality check
cc06d3e
4 months ago
by mtshiba
+0.49%
refactor
274bae8
4 months ago
by mtshiba
+0.89%
Merge branch 'main' into pr/17371
ca39add
3 months ago
by mtshiba
-1%
don't use return type context to specialize `__init__` type variables
0a80f98
3 months ago
by mtshiba
+0.91%
Update types.rs
f5e5165
3 months ago
by mtshiba
© 2026 CodSpeed Technology
Home Terms Privacy Docs