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

Performance History

Latest Results

[ty] Narrow tagged unions through all type kinds (#27226) ## Summary Closes astral-sh/ty#4100. That report wants attribute tagged-union narrowing on a union containing truthiness-guarded intersections (e.g. `A & ~AlwaysFalsy`). It was currently explicit in the attribute-tagged-union narrowing that it only operated on union elements that were nominal instances, but I couldn't find any soundness rationale for this restriction anywhere in the issues or PRs involved in adding this support, and I don't see why it can't apply to attribute access on any type. So this PR narrows tagged unions using the discriminator looked up on each complete union member, rather than limiting narrowing to nominal instances, which of course naturally supports the requested use case of truthiness-narrowed intersections. ## Test plan - Extend the existing equality mdtest with truthiness-guarded inherited and nested discriminants, one positive intersection, and one read-only structural protocol. - Extend the existing identity and attribute-truthiness mdtests with one prior-truthiness-guard regression each.
main
13 minutes ago
[ty] Avoid growing cached protocol members
charlie/callable-protocol-receiver-overloads
17 minutes ago
[ty] Inline tagged-union attribute lookups
cjm/4100-tagged-union-intersections
20 minutes ago
[ty] Narrow tagged unions through intersections
cjm/4100-tagged-union-intersections
1 hour ago
fix: gate PT018 fix safety behind preview
jesco-absolut:fix-20698-pt018-fix-safety
1 hour ago
Expose direct and reachable bindings for refactors
lerebear/push-oovplpxnovot
3 hours ago

Latest Branches

CodSpeed Performance Gauge
0%
[ty] Select callable protocol overloads by receiver#27227
24 minutes ago
ad031fe
charlie/callable-protocol-receiver-overloads
CodSpeed Performance Gauge
0%
[ty] Narrow tagged unions through all type kinds#27226
27 minutes ago
75ba959
cjm/4100-tagged-union-intersections
CodSpeed Performance Gauge
0%
1 hour ago
f939aeb
jesco-absolut:fix-20698-pt018-fix-safety
© 2026 CodSpeed Technology
Home Terms Privacy Docs