jacopy.Integer

class jacopy.Integer(value)

Bases: Atom

Integer literal.

Values -1, 0, 1 are cached as singletons so that structural equality with common sentinels is cheap and references like Zero and One compare identical under is.

Parameters:

value (int)

__init__(value)
Parameters:

value (int)

Methods

__init__(value)

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

children

Tuple of immediate children.

is_atom

value