friendlysam.opt.Sum.variables

Sum.variables

This property gives all leaves which are instances of Variable.

Examples

>>> x, y = Variable('x'), Variable('y')
>>> expr = (42 + x * y * 3.5) * 2
>>> expr.variables == {x, y}
True