Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[red-knot] Rename constraint to predicate #16382

Merged
merged 2 commits into from
Feb 25, 2025
Merged

[red-knot] Rename constraint to predicate #16382

merged 2 commits into from
Feb 25, 2025

Conversation

dcreager
Copy link
Member

In #16306 (comment), @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.

@dcreager dcreager added internal An internal refactor or improvement red-knot Multi-file analysis & type inference labels Feb 25, 2025
@dcreager dcreager merged commit b39a4ad into main Feb 25, 2025
21 checks passed
@dcreager dcreager deleted the dcreager/predicates branch February 25, 2025 19:52
dcreager added a commit that referenced this pull request Feb 25, 2025
* main:
  [red-knot] Rename constraint to predicate (#16382)
  [red-knot] Correct modeling of dunder calls (#16368)
  [red-knot] Handle possibly-unbound instance members (#16363)
@carljm
Copy link
Contributor

carljm commented Feb 26, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants