Condition

Condition

Condition()

Relations that evaluate to booleans

Methods

Name Description
__and__ Create a condition that is the logical and operation between two conditions (i.e., both should hold).
__bool__ Return the boolean value of the condition.
__invert__ Create a condition that takes the logical ‘not’ of the current condition.
__or__ Create a condition that is the logical ‘or’ operation between two conditions (i.e., at least one of the two should hold).
__repr__ Return a string representation of the condition.
__str__ Return a string representation of the condition.
eval Evaluate the condition.
to_req Convert the condition to a pattern restriction.

__and__

Condition.__and__(other: Condition) -> Condition

Create a condition that is the logical and operation between two conditions (i.e., both should hold).

Parameters

  • other (Condition) The other operand to combine or compare with.

__bool__

Condition.__bool__() -> bool

Return the boolean value of the condition.

__invert__

Condition.__invert__() -> Condition

Create a condition that takes the logical ‘not’ of the current condition.

__or__

Condition.__or__(other: Condition) -> Condition

Create a condition that is the logical ‘or’ operation between two conditions (i.e., at least one of the two should hold).

Parameters

  • other (Condition) The other operand to combine or compare with.

__repr__

Condition.__repr__() -> str

Return a string representation of the condition.

__str__

Condition.__str__() -> str

Return a string representation of the condition.

eval

Condition.eval() -> bool

Evaluate the condition.

to_req

Condition.to_req() -> PatternRestriction

Convert the condition to a pattern restriction.