Home | Trees | Indices | Help |
|
---|
|
object --+ | list --+ | Tree --+ | AbstractParentedTree --+ | ParentedTree
A Tree that automatically maintains parent pointers for single-parented trees. The following read-only property values are automatically updated whenever the structure of a parented tree is modified: parent, parent_index, left_sibling, right_sibling, root, treeposition.
Each ParentedTree
may have at most one parent. In
particular, subtrees may not be shared. Any attempt to reuse a single
ParentedTree
as a child of more than one parent (or as
multiple children of the same parent) will cause a
ValueError
exception to be raised.
ParentedTrees
should never be used in the same tree as
Trees
or MultiParentedTrees
. Mixing tree
implementations may result in incorrect parent pointers and in
TypeError
exceptions.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from Inherited from |
|
|||
Inherited from Inherited from |
|
|||
|
|||
_parent The parent of this Tree, or None if it has no parent.
|
|
|||
parent The parent of this tree, or None if it has no parent.
|
|||
parent_index The index of this tree in its parent. |
|||
left_sibling The left sibling of this tree, or None if it has none.
|
|||
right_sibling The right sibling of this tree, or None if it has none.
|
|||
root The root of this tree. |
|||
treeposition The tree position of this tree, relative to the root of the tree. |
|||
treepos The tree position of this tree, relative to the root of the tree. |
|||
Inherited from |
|
Construct a new tree. This constructor can be called in one of two ways:
|
|
Update
|
Update
|
|
parentThe parent of this tree, or
|
parent_indexThe index of this tree in its parent. I.e.,
|
left_siblingThe left sibling of this tree, or
|
right_siblingThe right sibling of this tree, or
|
rootThe root of this tree. I.e., the unique ancestor of this tree whose
parent is
|
treepositionThe tree position of this tree, relative to the root of the tree.
I.e.,
|
treeposThe tree position of this tree, relative to the root of the tree.
I.e.,
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed Aug 27 15:08:58 2008 | http://epydoc.sourceforge.net |