mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
![]() This breaks up call binding into two phases: - **_Matching parameters_** just looks at the names and kinds (positional/keyword) of each formal and actual parameters, and matches them up. Most of the current call binding errors happen during this phase. - Once we have matched up formal and actual parameters, we can **_infer types_** of each actual parameter, and **_check_** that each one is assignable to the corresponding formal parameter type. As part of this, we add information to each formal parameter about whether it is a type form or not. Once [PEP 747](https://peps.python.org/pep-0747/) is finalized, we can hook that up to this internal type form representation. This replaces the `ParameterExpectations` type, which did the same thing in a more ad hoc way. While we're here, we add a new fluent API for building `Parameter`s, which makes our signature constructors a bit nicer to read. We also eliminate a TODO where we were consuming types from the argument list instead of the bound parameter list when evaluating our special-case known functions. Closes #15460 --------- Co-authored-by: Micha Reiser <micha@reiser.io> |
||
---|---|---|
.. | ||
assert_type.md | ||
cast.md |