diff options
author | Georg Brandl <georg@python.org> | 2008-07-23 16:00:44 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-07-23 16:00:44 (GMT) |
commit | 8c81fdad332fb848e9792d342300c8a3c07a87a2 (patch) | |
tree | 6455256d645d72d0595a2cc67eb39ca804ad0170 /Doc/library | |
parent | d4c7e636a98323c1d88ab6936318d4052117dc10 (diff) | |
download | cpython-8c81fdad332fb848e9792d342300c8a3c07a87a2.zip cpython-8c81fdad332fb848e9792d342300c8a3c07a87a2.tar.gz cpython-8c81fdad332fb848e9792d342300c8a3c07a87a2.tar.bz2 |
Use correct indentation.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/itertools.rst | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 3cef985..5d3593e 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -675,17 +675,17 @@ which incur interpreter overhead. filtered = ifilter(operator.itemgetter(1), decorated) return imap(operator.itemgetter(0), filtered) - def combinations_with_replacement(iterable, r): - "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" - pool = tuple(iterable) - n = len(pool) - indices = [0] * r - yield tuple(pool[i] for i in indices) - while 1: - for i in reversed(range(r)): - if indices[i] != n - 1: - break - else: - return - indices[i:] = [indices[i] + 1] * (r - i) - yield tuple(pool[i] for i in indices) + def combinations_with_replacement(iterable, r): + "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC" + pool = tuple(iterable) + n = len(pool) + indices = [0] * r + yield tuple(pool[i] for i in indices) + while 1: + for i in reversed(range(r)): + if indices[i] != n - 1: + break + else: + return + indices[i:] = [indices[i] + 1] * (r - i) + yield tuple(pool[i] for i in indices) |