https://github.com/python/cpython/commit/71ec3533c60af5bf6f448c3c926db3f5e9168dd9
commit: 71ec3533c60af5bf6f448c3c926db3f5e9168dd9
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: rhettinger <[email protected]>
date: 2024-05-14T14:59:11Z
summary:

[3.12] Itertools docs: fix parameter names and indentation in Python 
equivalents (gh-118977) (#119042)

files:
M Doc/library/itertools.rst

diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index 44fe9b9c922f5f..fdcf1f8d1e353e 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -372,7 +372,7 @@ loops that truncate the stream.
               saved.append(element)
           while saved:
               for element in saved:
-                    yield element
+                  yield element
 
    Note, this member of the toolkit may require significant auxiliary storage
    (depending on the length of the iterable).
@@ -607,10 +607,10 @@ loops that truncate the stream.
    This function is roughly equivalent to the following code, except that the
    actual implementation does not build up intermediate results in memory::
 
-       def product(*args, repeat=1):
+       def product(*iterables, repeat=1):
            # product('ABCD', 'xy') → Ax Ay Bx By Cx Cy Dx Dy
            # product(range(2), repeat=3) → 000 001 010 011 100 101 110 111
-           pools = [tuple(pool) for pool in args] * repeat
+           pools = [tuple(pool) for pool in iterables] * repeat
            result = [[]]
            for pool in pools:
                result = [x+[y] for x in result for y in pool]
@@ -727,9 +727,9 @@ loops that truncate the stream.
    iterables are of uneven length, missing values are filled-in with 
*fillvalue*.
    Iteration continues until the longest iterable is exhausted.  Roughly 
equivalent to::
 
-      def zip_longest(*args, fillvalue=None):
+      def zip_longest(*iterables, fillvalue=None):
           # zip_longest('ABCD', 'xy', fillvalue='-') → Ax By C- D-
-          iterators = [iter(it) for it in args]
+          iterators = [iter(it) for it in iterables]
           num_active = len(iterators)
           if not num_active:
               return

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to