summaryrefslogtreecommitdiffstats
path: root/Doc/library/itertools.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/itertools.rst')
-rw-r--r--Doc/library/itertools.rst20
1 files changed, 10 insertions, 10 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 2bd18d0..67646c6 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -76,7 +76,7 @@ loops that truncate the stream.
.. function:: itertools.chain.from_iterable(iterable)
- Alternate constructor for :func:`chain`. Gets chained inputs from a
+ Alternate constructor for :func:`chain`. Gets chained inputs from a
single iterable argument that is evaluated lazily. Equivalent to::
@classmethod
@@ -93,9 +93,9 @@ loops that truncate the stream.
Return *r* length subsequences of elements from the input *iterable*.
- Combinations are emitted in lexicographic sort order. So, if the
+ Combinations are emitted in lexicographic sort order. So, if the
input *iterable* is sorted, the combination tuples will be produced
- in sorted order.
+ in sorted order.
Elements are treated as unique based on their position, not on their
value. So if the input elements are unique, there will be no repeat
@@ -314,7 +314,7 @@ loops that truncate the stream.
for i, element in enumerate(iterable):
if i == nexti:
yield element
- nexti = it.next()
+ nexti = it.next()
If *start* is ``None``, then iteration starts at zero. If *step* is ``None``,
then the step defaults to one.
@@ -380,12 +380,12 @@ loops that truncate the stream.
Return successive *r* length permutations of elements in the *iterable*.
If *r* is not specified or is ``None``, then *r* defaults to the length
- of the *iterable* and all possible full-length permutations
+ of the *iterable* and all possible full-length permutations
are generated.
- Permutations are emitted in lexicographic sort order. So, if the
+ Permutations are emitted in lexicographic sort order. So, if the
input *iterable* is sorted, the permutation tuples will be produced
- in sorted order.
+ in sorted order.
Elements are treated as unique based on their position, not on their
value. So if the input elements are unique, there will be no repeat
@@ -416,7 +416,7 @@ loops that truncate the stream.
else:
return
- The code for :func:`permutations` can be also expressed as a subsequence of
+ The code for :func:`permutations` can be also expressed as a subsequence of
:func:`product`, filtered to exclude entries with repeated elements (those
from the same position in the input pool)::
@@ -564,7 +564,7 @@ can be combined.
>>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28]
>>> for k, g in groupby(enumerate(data), lambda (i,x):i-x):
... print map(itemgetter(1), g)
- ...
+ ...
[1]
[4, 5, 6]
[10]
@@ -691,7 +691,7 @@ which incur interpreter overhead.
def unique_everseen(iterable, key=None):
"List unique elements, preserving order. Remember all elements ever seen."
# unique_everseen('AAAABBBCCDAABBB') --> A B C D
- # unique_everseen('ABBCcAD', str.lower) --> A B C D
+ # unique_everseen('ABBCcAD', str.lower) --> A B C D
seen = set()
seen_add = seen.add
if key is None: