jacopy.Power

class jacopy.Power(base, exp)

Bases: Expr

Exponentiation base ** exp.

No evaluation is performed; even Power(One, anything) is preserved. Later passes may rewrite trivial powers.

Parameters:
__init__(base, exp)
Parameters:

Methods

__init__(base, exp)

clone()

Return self.

find(predicate)

Yield descendants (including self) satisfying predicate.

replace_at(path, new)

Return a new tree with new spliced at path.

substitute_atom(dummy, target)

Return self with every occurrence of dummy replaced by target.

walk()

Pre-order traversal yielding self followed by descendants through children only.

Attributes

base

children

Tuple of immediate children.

exp

is_atom

property children: Tuple[Expr, ...]

Tuple of immediate children. Atoms return ().