Base condition
Condition ¶
Bases: ABC
Abstract base class for a condition that can be checked against an event.
check
abstractmethod
¶
check(event: Event[V]) -> bool
Check if the condition holds for the given event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Event[V]
|
The event to check. |
required |
__or__
abstractmethod
¶
Combine this condition with another condition using OR logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Condition
|
The other condition. |
required |
ConditionOperator ¶
Bases: Enum
Enum representing logical operators for condition combination.
__call__ ¶
__call__(*condition: Iterable[Any]) -> bool
Apply the logical operator to the given conditions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
condition
|
Iterable[Any]
|
The conditions to combine. |
()
|
Or ¶
Or(*conditions: Condition)
Bases: ConditionExpression
Composite condition representing the logical OR of its conditions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conditions
|
Condition
|
The conditions that make up the expression. |
()
|
And ¶
And(*conditions: Condition)
Bases: ConditionExpression
Composite condition representing the logical AND of its conditions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conditions
|
Condition
|
The conditions that make up the expression. |
()
|