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

[ty] Respect the gradual guarantee when narrowing using `isinstance()` and `issubclass()`

#18900Merged
Comparing
alex/isinstance-gradual
(
1cd4937
) with
main
(
fd2cc37
)
CodSpeed Performance Gauge
0%
Untouched
37

Benchmarks

37 total
linter/default-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
CodSpeed Performance Gauge
0%
194.9 µs195.8 µs
hydra-zen
crates/ruff_benchmark/benches/ty.rs::project::hydra::project
CodSpeed Performance Gauge
0%
743.2 ms745.1 ms
linter/default-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
CodSpeed Performance Gauge
0%
962.1 µs964.5 µs
attrs
crates/ruff_benchmark/benches/ty.rs::project::attrs::project
CodSpeed Performance Gauge
0%
364.6 ms365.5 ms
linter/default-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
CodSpeed Performance Gauge
0%
4 ms4 ms
ty_micro[many_string_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_string_assignments
CodSpeed Performance Gauge
0%
71.5 ms71.6 ms
ty_check_file[cold]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_cold
CodSpeed Performance Gauge
0%
122.1 ms122.3 ms
linter/default-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
CodSpeed Performance Gauge
0%
378.3 µs378.9 µs
anyio
crates/ruff_benchmark/benches/ty.rs::project::anyio::project
CodSpeed Performance Gauge
0%
885.1 ms886.1 ms
linter/default-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_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.1 ms2.1 ms
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_tuple_assignments
CodSpeed Performance Gauge
0%
207.2 ms207.4 ms
linter/all-rules[unicode/pypinyin.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
1.8 ms1.8 ms
linter/all-with-preview-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
800.8 µs800.4 µs
linter/all-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
4.1 ms4.1 ms
linter/all-with-preview-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
20.9 ms20.9 ms
linter/all-with-preview-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
4.8 ms4.8 ms
linter/all-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
8.4 ms8.4 ms
linter/all-with-preview-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
9.9 ms9.9 ms
ty_check_file[incremental]
crates/ruff_benchmark/benches/ty.rs::check_file::benchmark_incremental
CodSpeed Performance Gauge
0%
5.6 ms5.7 ms
linter/all-rules[large/dataset.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
17.3 ms17.3 ms
parser[large/dataset.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
4.9 ms4.9 ms
formatter[unicode/pypinyin.py]
crates/ruff_benchmark/benches/formatter.rs::formatter::benchmark_formatter
CodSpeed Performance Gauge
0%
664.8 µs664.8 µs
parser[numpy/globals.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
105.9 µs105.9 µs
parser[unicode/pypinyin.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
320.9 µs320.9 µs

Commits

Click on a commit to change the comparison range
Base
main
fd2cc37
+0.59%
[ty] Respect the gradual guarantee when narrowing using `isinstance()` and `issubclass()`
371c632
1 year ago
by AlexWaygood
-0.65%
even more extreme test
1cd4937
1 year ago
by AlexWaygood
© 2026 CodSpeed Technology
Home Terms Privacy Docs