var()
var() stores a named variable inside a grid. Read it with get(), update it with set() and an optional time-to-live.
The Var function in Origami Tech stores the variables.
var(name: str, default: decimal, cache_by: tuple=())
Function that is used for holding dynamic variables. Returns object that supports:
get() -> decimal
returns value of variable or default if unset
set(value: decimal, ttl: decimal=inf) -> decimal
set value to value , returns value
ttl - optional ttl of variable, default to inf
Examples:
get returns 5 if variable unset
Set variable’s value to 10
Example:
Last updated