]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Minor edit: Four space indent in example (#148264)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Wed, 8 Apr 2026 17:48:54 +0000 (12:48 -0500)
committerGitHub <noreply@github.com>
Wed, 8 Apr 2026 17:48:54 +0000 (12:48 -0500)
Doc/library/itertools.rst

index 06a71535b5c93cc0bccb6ee2e225c721817b3ebc..5a0ac60ab7d2ec956ac2d768198ee6d14fc8259d 100644 (file)
@@ -850,7 +850,7 @@ and :term:`generators <generator>` which incur interpreter overhead.
 
    def running_mean(iterable):
        "Yield the average of all values seen so far."
-       # running_mean([8.5, 9.5, 7.5, 6.5]) -> 8.5 9.0 8.5 8.0
+       # running_mean([8.5, 9.5, 7.5, 6.5])  8.5 9.0 8.5 8.0
        return map(truediv, accumulate(iterable), count(1))
 
    def repeatfunc(function, times=None, *args):
@@ -932,10 +932,10 @@ and :term:`generators <generator>` which incur interpreter overhead.
                    yield element
 
    def unique(iterable, key=None, reverse=False):
-      "Yield unique elements in sorted order. Supports unhashable inputs."
-      # unique([[1, 2], [3, 4], [1, 2]]) → [1, 2] [3, 4]
-      sequenced = sorted(iterable, key=key, reverse=reverse)
-      return unique_justseen(sequenced, key=key)
+       "Yield unique elements in sorted order. Supports unhashable inputs."
+       # unique([[1, 2], [3, 4], [1, 2]]) → [1, 2] [3, 4]
+       sequenced = sorted(iterable, key=key, reverse=reverse)
+       return unique_justseen(sequenced, key=key)
 
    def sliding_window(iterable, n):
        "Collect data into overlapping fixed-length chunks or blocks."