mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
[red-knot] Rename constraint to predicate (#16382)
In https://github.com/astral-sh/ruff/pull/16306#discussion_r1966290700, @carljm pointed out that #16306 introduced a terminology problem, with too many things called a "constraint". This is a follow-up PR that renames `Constraint` to `Predicate` to hopefully clear things up a bit. So now we have that: - a _predicate_ is a Python expression that might influence type inference - a _narrowing constraint_ is a list of predicates that constraint the type of a binding that is visible at a use - a _visibility constraint_ is a ternary formula of predicates that define whether a binding is visible or a statement is reachable This is a pure renaming, with no behavioral changes.
This commit is contained in:
parent
86b01d2d3c
commit
b39a4ad01d
10 changed files with 327 additions and 314 deletions
|
@ -25,10 +25,10 @@ use crate::Db;
|
|||
pub mod ast_ids;
|
||||
pub mod attribute_assignment;
|
||||
mod builder;
|
||||
pub(crate) mod constraint;
|
||||
pub mod definition;
|
||||
pub mod expression;
|
||||
mod narrowing_constraints;
|
||||
pub(crate) mod predicate;
|
||||
pub mod symbol;
|
||||
mod use_def;
|
||||
mod visibility_constraints;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue