finesse.symbols.LazySymbol

Overview

class finesse.symbols.LazySymbol(name, function, *args)[source]

Bases: Symbol

A generic way to make some lazily evaluated symbol.

The value is dependant on a lambda function and some arbitrary arguments which will be called when the symbol is evaluated.

Parameters:
namestr

Human readable string name for the symbol

functioncallable

Function to call when evaluating the symbol

*argsobjects

Arguments to pass to function when evaluating

Examples

>>> a = LazyVariable('a', lambda x: x**2, 10)
>>> print(a)
<Symbolic='(a*10)' @ 0x7fd6587e6760>
>>> print((a*10).eval())
1000

Properties

LazySymbol.name

Methods

LazySymbol.__init__(name, function, *args)

LazySymbol.eval(**kwargs)