Commits

Sergey Astanin  committed ad5e5f6

Minor edits in groupby() docstring.

  • Participants
  • Parent commits 156fdb9

Comments (0)

Files changed (1)

 
     predicate         a function on sequence elements
     sequence          original sequence
-    predicate_values  if given, build only subsequences for these
+    predicate_values  if given, build subsequences only for these
                       values of the predicate function
 
-    Unlike itertools.groupby, return only one iterator per predicate
-    value; argument order is reversed to match other functions in this
-    module.
+    Unlike itertools.groupby, return only one subsequence' iterator
+    per predicate value; argument order is reversed to match other
+    functions in this module.
 
     >>> [(k, list(i)) for k,i in groupby(lambda x: x%3, range(7))]
     [(0, [0, 3, 6]), (1, [1, 4]), (2, [2, 5])]
 
     This function is lazy and consumes sequence only on demand, but to
     build the comlete list of predicate values it needs to scan the
-    entire sequence. To avoid such an eager behaviour, the function can
-    take a list of possible predicate_values in advance:
+    entire sequence. To avoid such an eager behaviour, the function
+    can take a list of possible predicate_values in advance.
+
+    Working with a really long sequence:
 
     >>> if python_version_tuple()[0] > '2': xrange=range
     >>> gs = groupby(lambda x: x%3, xrange(int(1e9)), predicate_values=(0,1,2))