Package rrlog :: Module tool :: Class ListRotator
[hide private]
[frames] | no frames]

Class ListRotator

source code

object --+
         |
        ListRotator

Iteriert durch eine gegebene Liste, beginnend mit erstem Element. beginnt im Gegensatz zum Iterator wieder von vorn.

Instance Methods [hide private]
 
__init__(self, list)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
next(self)
Not threadsafe.
source code
 
len(self) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]
  i
index of last returned element
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, list)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • list - len >=1; Behaviour is not defined if list is changed later.
Overrides: object.__init__

next(self)

source code 

Not threadsafe.

Returns:
next list element, rotating
Raises:
  • IndexError - if list has length 0