| |
- __builtin__.object
-
- chain
- combinations
- combinations_with_replacement
- compress
- count
- cycle
- dropwhile
- groupby
- ifilter
- ifilterfalse
- imap
- islice
- izip
- izip_longest
- permutations
- product
- repeat
- starmap
- takewhile
class combinations(__builtin__.object) |
|
combinations(iterable, r) --> combinations object
Return successive r-length combinations of elements in the iterable.
combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3) |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __iter__(...)
- x.__iter__() <==> iter(x)
- next(...)
- x.next() -> the next value, or raise StopIteration
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class compress(__builtin__.object) |
|
compress(data, selectors) --> iterator over selected data
Return data elements corresponding to true selector elements.
Forms a shorter iterator from selected data elements using the
selectors to choose the data elements. |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __iter__(...)
- x.__iter__() <==> iter(x)
- next(...)
- x.next() -> the next value, or raise StopIteration
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class imap(__builtin__.object) |
|
imap(func, *iterables) --> imap object
Make an iterator that computes the function using arguments from
each of the iterables. Like map() except that it returns
an iterator instead of a list and that it stops when the shortest
iterable is exhausted instead of filling in None for shorter
iterables. |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __iter__(...)
- x.__iter__() <==> iter(x)
- next(...)
- x.next() -> the next value, or raise StopIteration
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class islice(__builtin__.object) |
|
islice(iterable, [start,] stop [, step]) --> islice object
Return an iterator whose next() method returns selected values from an
iterable. If start is specified, will skip all preceding elements;
otherwise, start defaults to zero. Step defaults to one. If
specified as another value, step determines how many values are
skipped between successive calls. Works like a slice() on a list
but returns an iterator. |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __iter__(...)
- x.__iter__() <==> iter(x)
- next(...)
- x.next() -> the next value, or raise StopIteration
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class izip(__builtin__.object) |
|
izip(iter1 [,iter2 [...]]) --> izip object
Return a izip object whose .next() method returns a tuple where
the i-th element comes from the i-th iterable argument. The .next()
method continues until the shortest iterable in the argument sequence
is exhausted and then it raises StopIteration. Works like the zip()
function but consumes less memory by returning an iterator instead of
a list. |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __iter__(...)
- x.__iter__() <==> iter(x)
- next(...)
- x.next() -> the next value, or raise StopIteration
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class izip_longest(__builtin__.object) |
|
izip_longest(iter1 [,iter2 [...]], [fillvalue=None]) --> izip_longest object
Return an izip_longest object whose .next() method returns a tuple where
the i-th element comes from the i-th iterable argument. The .next()
method continues until the longest iterable in the argument sequence
is exhausted and then it raises StopIteration. When the shorter iterables
are exhausted, the fillvalue is substituted in their place. The fillvalue
defaults to None or can be specified by a keyword argument. |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __iter__(...)
- x.__iter__() <==> iter(x)
- next(...)
- x.next() -> the next value, or raise StopIteration
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class permutations(__builtin__.object) |
|
permutations(iterable[, r]) --> permutations object
Return successive r-length permutations of elements in the iterable.
permutations(range(3), 2) --> (0,1), (0,2), (1,0), (1,2), (2,0), (2,1) |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __iter__(...)
- x.__iter__() <==> iter(x)
- next(...)
- x.next() -> the next value, or raise StopIteration
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class product(__builtin__.object) |
|
product(*iterables) --> product object
Cartesian product of input iterables. Equivalent to nested for-loops.
For example, product(A, B) returns the same as: ((x,y) for x in A for y in B).
The leftmost iterators are in the outermost for-loop, so the output tuples
cycle in a manner similar to an odometer (with the rightmost element changing
on every iteration).
To compute the product of an iterable with itself, specify the number
of repetitions with the optional repeat keyword argument. For example,
product(A, repeat=4) means the same as product(A, A, A, A).
product('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)
product((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ... |
|
Methods defined here:
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __iter__(...)
- x.__iter__() <==> iter(x)
- next(...)
- x.next() -> the next value, or raise StopIteration
Data and other attributes defined here:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
|