pygritia.ops module

Provides Operator lazy action class It makes operators work well in lazy expression

class pygritia.ops.Operator(operator: str, operands: Tuple[Any, ...])[source]

Bases: pygritia.core.LazyAction

Operator applied expression

evaluate(namespace: Mapping[Union[str, LazyMixin], Any]) → Any[source]

Evaluate expression

To substitute actual value for specific symbol, give value with keyword argument.

operands
operator
pygritia.ops.lazy_operator(method: _T) → _T[source]

Make given dunder method to lazy expression with Operator action.

pygritia.ops.lazy_roperator(method: _T) → _T[source]

Make given dunder method to lazy expression with Operator action. with reversed order