| Trees | Indices | Help |
|
|---|
|
|
object --+
|
Node.VLibNode --+
|
SupplyNode
base class for nodes which supply things
Assumptions:
1) no parents
Usage Example:
>>> supplier = SupplyNode(contents=[1,2,3])
>>> supplier.next()
1
>>> supplier.next()
2
>>> supplier.next()
3
>>> supplier.next()
Traceback (most recent call last):
...
StopIteration
>>> supplier.reset()
>>> supplier.next()
1
>>> [x for x in supplier]
[1, 2, 3]
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
x.__init__(...) initializes x; see help(type(x)) for signature
|
resets our iteration state
|
part of the iterator interface raises StopIteration on failure
|
>>> p1 = VLibNode() >>> p2 = VLibNode() >>> c1 = VLibNode() >>> c1.AddParent(p1) >>> len(c1.GetParents()) 1 >>> len(p1.GetChildren()) 1 >>> c1.AddParent(p2,notify=0) >>> len(c1.GetParents()) 2 >>> len(p2.GetChildren()) 0 >>> p2.AddChild(c1,notify=0) >>> len(c1.GetParents()) 2 >>> len(p2.GetChildren()) 1
|
part of the iterator interface raises StopIteration on failure
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Feb 1 16:13:01 2018 | http://epydoc.sourceforge.net |