Package smartcard :: Module ulist :: Class ulist
[hide private]
[frames] | no frames]

Class ulist

source code


ulist ensures that all items are unique and provides an __onadditem__ hook to perform custom action in subclasses.

Instance Methods [hide private]
new empty list
__init__(self, initlist=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__add__(self, other)
x+y
source code
 
__iadd__(self, other)
x+=y
source code
 
__radd__(self, other) source code
 
append(self, item)
append object to end
source code
 
insert(self, i, item)
insert object before index
source code
item
pop(self, i=-1)
remove and return item at index (default last).
source code
 
remove(self, item)
remove first occurrence of value.
source code
 
__remove_duplicates(self, _other)
Remove from other items already in list.
source code
 
__appendother__(self, other)
Append other to object.
source code
 
__onadditem__(self, item)
Called for each item added.
source code
 
__onremoveitem__(self, item)
Called for each item removed.
source code

Inherited from list: __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, count, extend, index, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, initlist=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns: new empty list
Overrides: object.__init__
(inherited documentation)

__add__(self, other)
(Addition operator)

source code 

x+y

Overrides: list.__add__
(inherited documentation)

__iadd__(self, other)

source code 

x+=y

Overrides: list.__iadd__
(inherited documentation)

append(self, item)

source code 

append object to end

Overrides: list.append
(inherited documentation)

insert(self, i, item)

source code 

insert object before index

Overrides: list.insert
(inherited documentation)

pop(self, i=-1)

source code 

remove and return item at index (default last). Raises IndexError if list is empty or index is out of range.

Returns: item
Overrides: list.pop
(inherited documentation)

remove(self, item)

source code 

remove first occurrence of value. Raises ValueError if the value is not present.

Overrides: list.remove
(inherited documentation)

__onadditem__(self, item)

source code 

Called for each item added. Override in subclasses for adding custom action.

__onremoveitem__(self, item)

source code 

Called for each item removed. Override in subclasses for adding custom action.