Commit ee6a6d1
authored
[ty] Support ParamSpecs in
## Summary
Part of astral-sh/ty#3555. Depends on #28094.
Support ParamSpecs in the internal `ConstraintSet.range`, `lower_bound`,
`upper_bound`, and `equality` constructors. Share normalization for
concrete and symbolic parameter-list bounds, preserving full signatures,
overloads, and generic binders while erasing callable return types.
Use parameter-list bottom/top as the effective defaults for missing
ParamSpec endpoints, while keeping absent and explicitly supplied bounds
distinct in storage. Recognize unrestricted ParamSpec ranges without
discarding supplied bounds as inference evidence. Allow bare ParamSpecs
during argument inference for these four internal constructors.
Solution extraction and specialization inference remain out of scope.
## Test Plan
- Concrete, symbolic, aliased, gradual, and overloaded bounds across the
constructors.
- Parameter kinds, defaults, variadics, return erasure, and
generic-binder preservation.
- Missing-bound equivalence to explicit parameter-list extrema and
preservation of absent versus supplied evidence.
- Self-bound constraints and unrestricted ParamSpec ranges.
- Invalid parameter-list bounds and ordinary TypeVar,
ParamSpec-component, TypeVarTuple, and subsequent unrelated TypeForm
controls.ConstraintSet (#28028)1 parent 7f6a170 commit ee6a6d1
7 files changed
Lines changed: 697 additions & 52 deletions
File tree
- crates/ty_python_semantic
- resources/mdtest/type_properties
- src/types
- call
- constraints
- infer
0 commit comments