Table of Contents

Class: DerivedCondition ./src/peak/events/sources.py

DerivedCondition(formula, *values) - derive condition from value(s)

Usage:

        # 'derived' is re-evaluated whenever x or y change
        derived = DerivedCondition(lambda: x()>=y(), x, y)

A DerivedCondition fires an event equal to formula() whenever any of the supplied values fire, the value of formula() is not equal to its last known value (if any), and the value of formula() is true.

Note that like other events.IConditional implementations, callbacks added to a DerivedCondition will be fired immediately if the current value of formula() is true, and tasks yielding to a true DerivedCondition will also proceed immediately without waiting for a callback.

Base Classes   
ReadableAsCondition
Methods   
__init__
  __init__ 
__init__ (
        self,
        formula,
        *values,
        )


Table of Contents

This document was automatically generated on Mon Apr 15 01:11:04 2024 by HappyDoc version 2.1