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

[ty] Respect `__new__` and metaclass `__call__` return types

#22317Closed
Comparing
charlie/metaclass
(
0748c17
) with
main
(
39c3636
)
CodSpeed Performance Gauge
0%
Untouched
107

Benchmarks

107 total
multithreaded
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
+1%
1.3 s1.3 s
pandas
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
69.3 s69 s
ty_micro[complex_constrained_attributes_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_complex_constrained_attributes_2
CodSpeed Performance Gauge
0%
71.5 ms71.2 ms
static_frame
crates/ruff_benchmark/benches/ty_walltime.rs
CodSpeed Performance Gauge
0%
21.4 s21.4 s
DateType
crates/ruff_benchmark/benches/ty.rs::project::datetype::project
CodSpeed Performance Gauge
0%
224.5 ms224 ms
hydra-zen
crates/ruff_benchmark/benches/ty.rs::project::hydra::project
CodSpeed Performance Gauge
0%
72.5 MB72.3 MB
ty_micro[many_tuple_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_tuple_assignments
CodSpeed Performance Gauge
0%
69.2 ms69.1 ms
ty_micro[large_isinstance_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_large_isinstance_narrowing
CodSpeed Performance Gauge
0%
145 ms144.9 ms
ty_micro[pandas_tdd]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_pandas_tdd
CodSpeed Performance Gauge
0%
251.9 ms251.7 ms
parser[numpy/globals.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
105.5 µs105.4 µs
ty_micro[large_union_narrowing]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_large_union_narrowing
CodSpeed Performance Gauge
0%
496.1 ms495.8 ms
ty_micro[many_enum_members_2]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_enum_members_2
CodSpeed Performance Gauge
0%
160.2 ms160.2 ms
ty_micro[many_string_assignments]
crates/ruff_benchmark/benches/ty.rs::micro::benchmark_many_string_assignments
CodSpeed Performance Gauge
0%
81.8 ms81.8 ms
anyio
crates/ruff_benchmark/benches/ty.rs::project::anyio::project
CodSpeed Performance Gauge
0%
1.2 s1.2 s
linter/default-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::default_rules::benchmark_default_rules
CodSpeed Performance Gauge
0%
212.8 µs212.7 µs
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.3 ms
linter/all-with-preview-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
850.1 µs849.9 µs
linter/all-rules[numpy/globals.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
754 µs753.8 µ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
attrs
crates/ruff_benchmark/benches/ty.rs::project::attrs::project
CodSpeed Performance Gauge
0%
469.4 ms469.4 ms
parser[unicode/pypinyin.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
314.8 µs314.7 µs
linter/all-with-preview-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::preview_rules::benchmark_preview_rules
CodSpeed Performance Gauge
0%
5.3 ms5.3 ms
linter/all-rules[pydantic/types.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
8.9 ms8.9 ms
linter/all-rules[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/linter.rs::all_rules::benchmark_all_rules
CodSpeed Performance Gauge
0%
4.5 ms4.5 ms
parser[numpy/ctypeslib.py]
crates/ruff_benchmark/benches/parser.rs::parser::benchmark_parser
CodSpeed Performance Gauge
0%
902.6 µs902.5 µs

Commits

Click on a commit to change the comparison range
Base
main
39c3636
-9.86%
Preserve mixed-constructor __init__ checks and constructor specialization
b000abb
1 month ago
by charliermarsh
+0.45%
Simplify some code paths
c1deab9
1 month ago
by charliermarsh
+0.1%
HACK: Attempt to fix performance regression
5202507
1 month ago
by charliermarsh
-1.12%
HACK: Attempt to fix performance regression
a3decc5
1 month ago
by charliermarsh
+1%
HACK: Attempt to fix performance regression
6034460
1 month ago
by charliermarsh
+9.43%
move mixed-constructor-init down into CallableBindings
8799e1d
1 month ago
by carljm
-10.17%
fix semantic conflict with main merge
7eb1295
1 month ago
by carljm
+0.95%
Revert "HACK: Attempt to fix performance regression"
852e841
1 month ago
by carljm
-0.64%
non-instance metaclass __call__ bypasses __new__ and __init__
26e1cc8
1 month ago
by carljm
+9.86%
expand on SQLModel test
33b07a6
1 month ago
by carljm
-8.89%
adjust comment on one test
39e2fcb
1 month ago
by carljm
+0.43%
Merge branch 'main' into charlie/metaclass
d333479
1 month ago
by carljm
-1.57%
add a test for mixed __new__ overloads
368d547
1 month ago
by carljm
-0.05%
another pass on the tests
2366648
1 month ago
by carljm
+9.8%
try a simpler approach
98dfba0
1 month ago
by carljm
-0.01%
move __new__ return type tests to call/constructor.md
a83276d
1 month ago
by carljm
+0.03%
fix specialization inference from __init__ scoped typevars
373c0c6
1 month ago
by carljm
+0.01%
combine some redundant test cases
507da68
1 month ago
by carljm
+0.07%
instance-returning should be regardless of specialization
f9fb899
1 month ago
by carljm
+0.06%
remove some special-casing of not-fully-resolved generic return types
505d391
1 month ago
by carljm
-0.08%
Merge branch 'main' into charlie/metaclass
cceb9b7
1 month ago
by carljm
+0.43%
simplify DownstreamConstructor::return_kind
efc346f
1 month ago
by carljm
-0.23%
simplify constructor_bindings
eef68a3
1 month ago
by carljm
+5%
allow non-method metaclass __call__
f63bb01
1 month ago
by carljm
-0.72%
Merge branch 'main' into charlie/metaclass
5dec12a
20 days ago
by carljm
+3.34%
fix type errors in scripts/check_ecosystem.py
3fbd18f
20 days ago
by carljm
+0.26%
rename CallAlternative to CallableItem
684f494
20 days ago
by carljm
-1.8%
require a known ConstructorCallableKind
7fcfe15
20 days ago
by carljm
-6.17%
extend type context fix to Self also
7c157a6
19 days ago
by carljm
+0.22%
fix some return-type/literal-promotion cases
6ce3604
19 days ago
by carljm
-0.35%
Merge branch 'main' into charlie/metaclass
589c5d9
19 days ago
by carljm
+0.01%
Merge branch 'main' into charlie/metaclass
b2cd8ed
19 days ago
by carljm
-4.76%
extract constructor.rs submodule
cd13bd0
18 days ago
by carljm
-0.19%
future-proof CallableItem::map
a089838
18 days ago
by carljm
+5.03%
avoid creating lots of set-theoretic type builders
078c04a
18 days ago
by carljm
+0.12%
remove ConstructorReturnOutcome enum
8b6bf8e
11 days ago
by carljm
-0.03%
fix up semantic conflicts from main
91d2292
11 days ago
by carljm
+0.09%
add a comment
fe98d75
5 days ago
by carljm
-0.09%
Merge branch 'main' into charlie/metaclass
0748c17
4 days ago
by carljm
© 2026 CodSpeed Technology
Home Terms Privacy Docs