Package DebTorrent :: Package BT1 :: Module StorageWrapper :: Class Olist
[hide private]
[frames] | no frames]

Class Olist

source code

A list that will be popped in order.

Instance Methods [hide private]
 
__init__(self, l=[])
Initialize the instance.
source code
int
__len__(self)
Get the length of the list.
source code
boolean
includes(self, i)
Check if the list includes a value.
source code
 
add(self, i)
Add a value to the list.
source code
 
extend(self, l)
Extend the list with multiple new values.
source code
unknown
pop(self, n=0)
Remove a value from the list and return it.
source code
 
remove(self, i)
Remove a value from the list.
source code
Instance Variables [hide private]
dictionary d
the ordered list, keys are the list entries
Method Details [hide private]

__init__(self, l=[])
(Constructor)

source code 
Initialize the instance.
Parameters:
  • l (list) - the list to initialize the instance with (optional, defaults to an empty initialization)

__len__(self)
(Length operator)

source code 
Get the length of the list.
Returns: int
the length of the list

includes(self, i)

source code 
Check if the list includes a value.
Parameters:
  • i (unknown) - the value to check the list for
Returns: boolean
whether the list already includes the value

add(self, i)

source code 
Add a value to the list.
Parameters:
  • i (unknown) - the value to add to the list

extend(self, l)

source code 
Extend the list with multiple new values.
Parameters:
  • l (list) - the list of values to add to the list

pop(self, n=0)

source code 
Remove a value from the list and return it.
Parameters:
  • n (int) - the list item to pop:
       -1 -- the smallest item is popped
        0 -- the largest item is popped (default)
        n -- the nth item in the list is popped
    
Returns: unknown
the value popped from the list

remove(self, i)

source code 
Remove a value from the list.
Parameters:
  • i (unknown) - the value to remove from the list