Source code for text_lint.operations.validators.expressions.bases.expression_base
"""ExpressionBase class."""
import abc
from typing import Union
[docs]
class ExpressionBase(abc.ABC):
"""Base class for mathematical expressions."""
operator: str
[docs]
@abc.abstractmethod
def apply(self, value_a: float, value_b: float) -> Union[float, bool]:
"""Apply the mathematical operator to these two values.
:param value_a: The first value the operator will apply to.
:param value_b: The second value the operator will apply to.
:returns: The result of the operation.
"""