Skip to main content

Module predicate

Module predicate 

Source
Expand description

Predicates are Python expressions whose runtime values can affect type inference.

We currently use predicates in two places:

Structs§

CallableAndCallExpr
ClassPatternKeywordPredicateKind
ClassPatternPredicateKind
Structural details for a class pattern.
MappingPatternEntryPredicateKind
MappingPatternPredicateKind
Structural details for a mapping pattern.
PatternPredicate
Predicate
ScopedPredicateId
SequencePatternPredicateKind
Structural details for sequence patterns that affect narrowing and reachability.
StarImportPlaceholderPredicate
A “placeholder predicate” that is used to model the fact that the boundness of a (possible) definition or declaration caused by a * import cannot be fully determined until type- inference time. This is essentially the same as a standard reachability constraint, so we reuse the Predicate infrastructure to model it.
SubjectElementPatternPredicate
A pattern predicate applied to one expression in a sequence-display subject.

Enums§

PatternPredicateKind
Pattern structure used for type narrowing, static reachability, and inferring the types of names bound by a successful match.
PredicateNode

Type Aliases§

Predicates