ruff
ce7a42e1 - [ty] Refine parameter kind handling across ty semantic analysis (#26582)

Commit
9 days ago
[ty] Refine parameter kind handling across ty semantic analysis (#26582) ## Summary Follow up to https://github.com/astral-sh/ruff/pull/26521: update callable, method, override, and signature handling to account for parameter kinds more consistently. That PR left a number of similar cases (where we were wrongly making a generic callable gradual after specializing it to Any) unfixed, and introduced a `Parameter::from_annotation` method that was still wrongly used in many non-annotation locations. * Introduce a `Parameters::standard` helper for creating an always-non-gradual synthetic callable. Many prior uses of `Parameter::from_annotation` are switched to use this instead. By lines, this is the bulk of the diff. * Cycle normalization uses `::new` and explicitly passes on the `ParametersKind`, rather than using `::from_annotation`. * Introduce `::with_prefix` and `::with_transformed_parameters` constructors for cloning existing signatures with new prefix parameters or transformed parameters, respectively. These have only a few uses. After this PR, `::from_annotation` is used only in cases that actually come from user annotations directly. ## Testing Added mdtests.
Author
Parents
Loading