astral-sh
ruff
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
fix: update literal limit test
Minibrams:main
23 minutes ago
[ty] Ignore `_generate_next_value_` with custom construction hooks (#25210) ## Summary One oversight in my changes to https://github.com/astral-sh/ruff/pull/25196: if a custom `__new__` is defined, we should treat the alias value as `Any`, rather than relying on `_generate_next_value_`. This matches Pyright, for example. E.g., given: ```python class E(Enum): @staticmethod def _generate_next_value_(...) -> Literal["x"]: return "x" def __new__(cls, value: str): obj = object.__new__(cls) obj._value_ = object() return obj A = auto() B = auto() ``` Prior to this change, we treated `B` as an alias of `A`; but if `__new__` is defined, we don't attempt to detect the alias.
main
2 hours ago
Add quick fix to remove redundant cast
sqqueak:quick-fix-redundant-cast
5 hours ago
Only apply to custom news
charlie/gennextvalue
8 hours ago
[ty] Ignore _generate_next_value_ with custom construction hooks
charlie/gennextvalue
8 hours ago
[ty] Support for custom `_generate_next_value_` in enums (#25196) ## Summary https://github.com/astral-sh/ty/issues/876 This PR adds support for custom `_generate_next_value_` methods on enums. When set, this return type will take precedence over inferred `auto()` member types unless an explicit `_value_` annotation is set. Falls back to `Any` if custom hooks (like `__init__`) are detected. References: - https://typing.python.org/en/latest/spec/enums.html#member-values - https://docs.python.org/3/library/enum.html#enum.Enum._generate_next_value_ ## Test Plan New mdtests --------- Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
main
8 hours ago
Reduce indent
charlie/class-decorators
8 hours ago
Respect _generate_next_value_ for auto()
thejchap:thejchap/gennextvalue
8 hours ago
Latest Branches
CodSpeed Performance Gauge
-97%
[ty] Higher limit for number of non-recursive union literals
#25212
30 minutes ago
0616e40
Minibrams:main
CodSpeed Performance Gauge
0%
[ty] Add quick fix to remove redundant cast
#25211
8 hours ago
ec10b26
sqqueak:quick-fix-redundant-cast
CodSpeed Performance Gauge
0%
[ty] Ignore `_generate_next_value_` with custom construction hooks
#25210
8 hours ago
4d7e503
charlie/gennextvalue
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs