designspace.Condition#

class designspace.Condition(target: str, expr: BoolExpr, params: frozenset[str])#

Bases: object

When one parameter is active, as resolved IR.

Produced by .when(), and injected automatically by struct and choice nesting: a variant’s payload parameters each get a condition on the discriminator. A parameter with no condition is unconditionally active.

target#

The parameter this condition governs.

Type:

str

expr#

The predicate. The target is active exactly when it holds.

Type:

BoolExpr

params#

Every parameter path expr reads. These must be assigned before the target’s activity can be decided, which is what puts the condition in the dependency graph.

Type:

frozenset[str]