Package ClusterShell :: Module NodeSet :: Class NodeSetBase
[hide private]
[frames] | no frames]

Class NodeSetBase

source code


Base class for NodeSet.

Instance Methods [hide private]
 
__init__(self, pattern=None, rangeset=None)
Initialize an empty NodeSetBase.
source code
 
_iter(self)
Iterator on internal item tuples (pattern, index, padding).
source code
 
_iterbase(self)
Iterator on single, one-item NodeSetBase objects.
source code
 
__iter__(self)
Iterator on single nodes as string.
source code
 
__len__(self)
Get the number of nodes in NodeSet.
source code
 
__str__(self)
Get ranges-based pattern of node list.
source code
 
__contains__(self, other)
Is node contained in NodeSet ?
source code
 
_binary_sanity_check(self, other) source code
 
issubset(self, other)
Report whether another nodeset contains this nodeset.
source code
 
issuperset(self, other)
Report whether this nodeset contains another nodeset.
source code
 
__eq__(self, other)
NodeSet equality comparison.
source code
 
__le__(self, other)
Report whether another nodeset contains this nodeset.
source code
 
__ge__(self, other)
Report whether this nodeset contains another nodeset.
source code
 
__lt__(x, y)
x<y
source code
 
__gt__(x, y)
x>y
source code
 
__getitem__(self, i)
Return the node at index i.
source code
 
_add(self, pat, rangeset)
Add nodes from a (pat, rangeset) tuple.
source code
 
union(self, other)
s.union(t) returns a new set with elements from both s and t.
source code
 
__or__(self, other)
Implements the | operator.
source code
 
add(self, other)
Add node to NodeSet.
source code
 
update(self, other)
s.update(t) returns nodeset s with elements added from t.
source code
 
clear(self)
Remove all nodes from this nodeset.
source code
 
__ior__(self, other)
Implements the |= operator.
source code
 
intersection(self, other)
s.intersection(t) returns a new set with elements common to s and t.
source code
 
__and__(self, other)
Implements the & operator.
source code
 
intersection_update(self, other)
s.intersection_update(t) returns nodeset s keeping only elements also found in t.
source code
 
__iand__(self, other)
Implements the &= operator.
source code
 
difference(self, other)
s.difference(t) returns a new NodeSet with elements in s but not in t.
source code
 
__sub__(self, other)
Implement the - operator.
source code
 
difference_update(self, other, strict=False)
s.difference_update(t) returns nodeset s after removing elements found in t.
source code
 
__isub__(self, other)
Implement the -= operator.
source code
 
remove(self, elem)
Remove element elem from the nodeset.
source code
 
symmetric_difference(self, other)
s.symmetric_difference(t) returns the symmetric difference of two nodesets as a new NodeSet.
source code
 
__xor__(self, other)
Implement the ^ operator.
source code
 
symmetric_difference_update(self, other)
s.symmetric_difference_update(t) returns nodeset s keeping all nodes that are in exactly one of the nodesets.
source code
 
__ixor__(self, other)
Implement the ^= operator.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pattern=None, rangeset=None)
(Constructor)

source code 

Initialize an empty NodeSetBase.

Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

Get ranges-based pattern of node list.

Overrides: object.__str__

__getitem__(self, i)
(Indexing operator)

source code 

Return the node at index i. For convenience only, not optimized as of version 1.0.

_add(self, pat, rangeset)

source code 

Add nodes from a (pat, rangeset) tuple. `pat' may be an existing pattern and `rangeset' may be None.

__or__(self, other)
(Or operator)

source code 

Implements the | operator. So s | t returns a new nodeset with elements from both s and t.

__ior__(self, other)

source code 

Implements the |= operator. So s |= t returns nodeset s with elements added from t. (Python version 2.5+ required)

__and__(self, other)
(And operator)

source code 

Implements the & operator. So s & t returns a new nodeset with elements common to s and t.

__iand__(self, other)

source code 

Implements the &= operator. So s &= t returns nodeset s keeping only elements also found in t. (Python version 2.5+ required)

__sub__(self, other)
(Subtraction operator)

source code 

Implement the - operator. So s - t returns a new nodeset with elements in s but not in t.

difference_update(self, other, strict=False)

source code 

s.difference_update(t) returns nodeset s after removing elements found in t. If strict is True, raise KeyError if an element cannot be removed.

__isub__(self, other)

source code 

Implement the -= operator. So s -= t returns nodeset s after removing elements found in t. (Python version 2.5+ required)

remove(self, elem)

source code 

Remove element elem from the nodeset. Raise KeyError if elem is not contained in the nodeset.

symmetric_difference(self, other)

source code 

s.symmetric_difference(t) returns the symmetric difference of two nodesets as a new NodeSet.

(ie. all nodes that are in exactly one of the nodesets.)

__xor__(self, other)
(Exclusive-Or operator)

source code 

Implement the ^ operator. So s ^ t returns a new NodeSet with nodes that are in exactly one of the nodesets.

__ixor__(self, other)

source code 

Implement the ^= operator. So s ^= t returns nodeset s after keeping all nodes that are in exactly one of the nodesets. (Python version 2.5+ required)