astral-sh
ruff
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
[ty] Add support for functional TypedDict
charlie/functional-typed
11 minutes ago
[ty] Add support for functional TypedDict
charlie/functional-typed
49 minutes ago
Support decorator=
charlie/functional-dict
1 hour ago
[ty] Avoid widening exact operations during is narrowing
charlie/narrow-value
2 hours ago
[ty] Avoid widening exact operations during is narrowing
charlie/narrow-value
3 hours ago
[ty] Avoid unnecessarily allocating Union/IntersectionBuilder (#24036) ## Summary We have several places where we optimize the just-one-type case in order to avoid calling `UnionType::from_elements` or `IntersectionType::from_elements`. Rather than implementing this optimization ad-hoc at various call sites, implement it inside the two `from_elements` methods, so callers never need to worry about just calling them. This PR is perf-neutral, but removing the existing optimizations causes meaningful regression. This just consolidates those existing necessary optimizations so that all callers get them. This is not _purely_ a refactor, as passing a type through union/intersection building can unpack a type alias, but I consider that a neutral or positive change. There's no need to unpack an alias if we aren't actually unioning or intersecting it with anything. One downside of this change is that we have to repeat the fact that an empty union is `Never` and an empty intersection is `object` in a second place. But this is not a fact that is likely to change, so I think that's worth the optimization. ## Test Plan Existing CI.
main
3 hours ago
Bump ecosystem-analyzer pin to latest upstream SHA (#24090) ## Summary cc6b94a -> 79409a4 ## Test Plan <!-- How was it tested? --> Co-authored-by: Claude <noreply@anthropic.com>
main
6 hours ago
[ty] Infer yield expression (#23796) ## Summary Infer yield and yield from expression using function annotation. Part of https://github.com/astral-sh/ty/issues/1718 Remaining part is checking return types, I'm planning to do that in a separate PR. All the remaining conformance tests are because of the return type checking. ## Notes Mixing Generator and Async Generator is allowed. ```py def async_returns_generator() -> Generator[int, int, None] | AsyncGenerator[int, int]: x = yield 1 reveal_type(x) return None ``` I was not sure if there's valid use case for this or not. But I found [this code](https://github.com/vippsas/zeroeventhub/blob/main/python/zeroeventhub/zeroeventhub/data_reader.py#L22) and [mypy](https://mypy-play.net/?gist=4293848a184dac5a7b49d3a7b5ed71c8) allows this. So I'm not doing any checks for this case. Just the normal logic that unions the types. [Pyright](https://pyright-play.net/?pyrightVersion=1.1.405&strict=true&code=GYJw9gtgBALgngBwJYDsDmUkQWEMogCmAboQIYA2A%2BvAoQFCiSyKoZY55QDihKhIMjFwAaKAEEAznBQBjXv0HCQ9egBNCwKGWlyqRGAFcQKSVTR8BQ3AAoAlFAC0APh6WluANqoYYn2IA5MH4AXSgAHwldeXdrEG8UX0xEkIAueihMqAAPKABeKDgkQgo1KABGDKyiUkoaREIbbLsqzINjFCgg-iA) rejects this. --------- Co-authored-by: David Peter <mail@david-peter.de>
main
6 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
[ty] Add support for functional `TypedDict(...)`
#24092
2 months ago
bc66412
charlie/functional-typed
CodSpeed Performance Gauge
-1%
[ty] Add support for dynamic dataclasses via `make_dataclass`
#23752
15 days ago
1f9da01
charlie/functional-dict
CodSpeed Performance Gauge
0%
[ty] Avoid widening exact operations during `is` narrowing
#24091
3 hours ago
b97f1e5
charlie/narrow-value
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs