Package lastfm :: Module lazylist :: Class LazyList

[hide private]
[frames] | no frames]

# Class LazyList

source code

    object --+
             |
            LazyList

Known Subclasses:
  - RecursiveLazyList

A Sequence whose values are computed lazily by an iterator.

Instance Methods | [hide private]

__init__(self, iterable) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code

__len__(self) Get the length of a LazyList's computed data. | source code

__getitem__(self, i) Get an item from a LazyList. | source code

__iter__(self) return an iterator over each value in the sequence, whether it has been computed yet or not. | source code

computed(self) Return an iterator over the values in a LazyList that have already been computed. | source code

exhaust(self, index=None) Exhaust the iterator generating this LazyList's values. | source code

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

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, iterable)
(Constructor)

source code

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

Overrides: object.__init__
  (inherited documentation)

### __getitem__(self, i)
(Indexing operator)

source code

Get an item from a LazyList. i should be a positive integer or a slice object.

### exhaust(self, index=None)

source code

Exhaust the iterator generating this LazyList's values. if index is None, this will exhaust the iterator completely. Otherwise, it will iterate over the iterator until either the list has a value for index or the iterator is exhausted.