FuPy logo

Tracing of Func and Lazy evaluations

The function trace can be used to trace evaluation of expressions:

  • trace(lambda: expr) returns a tuple consisting of the result of evaluating expr and a (printable) trace of all evaluation steps.

  • The optional boolean parameter live can be used to enable “live tracing”, where evaluation steps are printed to stdout as they happen.

  • The optional parameter skip_steps can be used to suppress selected set of tracing steps. For example, setting skip_steps = {DefinitionStep} suppresses function definition steps in the trace.

For examples see Basics and demo.py.