Condition#

class cli_interview_kit.Condition[source]#

Bases: FrozenModel

An answer, option or fact a question depends on.

Attributes:
keystr

An earlier question’s key, an option’s dest, or a fact.

is_intuple[str | bool, …]

The values that satisfy the condition.

Methods

holds(context)

Return whether the context's value is one of is_in.

describe()

Return the condition as text, e.g. source_type is files.

holds(context: Mapping[str, Any]) → bool[source]#

Return whether the context’s value is one of is_in.

Parameters:
contextMapping[str, Any]

The values conditions see: options, answers and facts, by key.

Returns:
bool

Whether the condition holds.

describe() → str[source]#

Return the condition as text, e.g. source_type is files.

Returns:
str

The condition as text.