Term

class pypagate.Term(_value: Any = None, _parents: list[Formula | Law] = <factory>, _binds: list[tuple[~typing.Any, ~typing.Any]]=<factory>, _fire_on: list[Callable] = <factory>, _on_change: list[Callable] = <factory>, _var_count: int = 0)

Bases: object

Essentially a variable that may be updated by the user. Can be included in more complicated formula and whenever it is changed, the parent formula are also updated to reflect this change.

Methods Summary

change(new_value)

Change the wrapped value of the term.

unwrap()

Returns the value of the Term at the current moment.

Methods Documentation

change(new_value)

Change the wrapped value of the term. (Internally updates formulas that use this term.)

Parameters:

new_value – The value to change self.value to.

unwrap()

Returns the value of the Term at the current moment.