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

[ty] Object type narrowing from attribute constraints

#19064
Comparing
mtshiba:643-adv-attr-narrowing
(
c893c5d
) with
main
(
b8653a9
)
CodSpeed Performance Gauge
-12%
Archived
8

Benchmarks

8 total
small[pydantic]
crates/ruff_benchmark/benches/ty_walltime.rs
Archived
CodSpeed Performance Gauge
-5%
2.9 s3 s
medium[pandas]
crates/ruff_benchmark/benches/ty_walltime.rs
Archived
CodSpeed Performance Gauge
-3%
34.2 s35 s
small[freqtrade]
crates/ruff_benchmark/benches/ty_walltime.rs
Archived
CodSpeed Performance Gauge
-4%
4.6 s4.8 s
small[altair]
crates/ruff_benchmark/benches/ty_walltime.rs
Archived
CodSpeed Performance Gauge
-1%
3 s3.1 s
large[sympy]
crates/ruff_benchmark/benches/ty_walltime.rs
Archived
CodSpeed Performance Gauge
-12%
53.4 s60.5 s
medium[colour-science]
crates/ruff_benchmark/benches/ty_walltime.rs
Archived
CodSpeed Performance Gauge
-1%
8.8 s8.8 s
small[tanjun]
crates/ruff_benchmark/benches/ty_walltime.rs
Archived
CodSpeed Performance Gauge
-4%
2 s2.1 s
multithreaded[pydantic]
crates/ruff_benchmark/benches/ty_walltime.rs
Archived
CodSpeed Performance Gauge
-5%
2.9 s3.1 s

Commits

Click on a commit to change the comparison range
Base
main
b8653a9
-12.38%
[ty] Narrow object types using constraints on attributes
6f3ba56
8 months ago
by mtshiba
+0.55%
Constraints imposed by call expressions are not subject to additional constraints
c893c5d
8 months ago
by mtshiba
© 2026 CodSpeed Technology
Home Terms Privacy Docs