Package aterm :: Module path :: Class Path
[frames] | no frames]

Class Path




A path is a term comprehending a list of integer indexes which indicate the position of a term relative to the root term.

When a path is read/written to a string/list, indexes are listed ordely from the root to the leaves. However, when a path is read/written to a term, the indexes are from the leaves to the root, to take advantage of the maximal sharing.

Instance Methods
 
__init__(self, indices)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
compare(self, other)
Rich path comparison.
 
equals(self, other)
 
__eq__(self, other)
 
contains(self, other)
 
contained(self, other)
 
contains_range(self, start, end)
 
contained_in_range(self, start, end)
 
ancestor(self, other)
Find the common ancestor of two paths.
 
project(self, term)
Projects the subterm specified by a path.
 
transform(self, term, func)
 
toTerm(self)
 
toStr(self)
str(x)
 
__str__(self)
str(x)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Class Methods
 
fromTerm(cls, trm)
 
fromStr(cls, s)
Properties

Inherited from object: __class__

Method Details

__init__(self, indices)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

 
str(x)
Overrides: object.__str__
(inherited documentation)