@@ -372,7 +372,7 @@ loops that truncate the stream.
372
372
saved.append(element)
373
373
while saved:
374
374
for element in saved:
375
- yield element
375
+ yield element
376
376
377
377
Note, this member of the toolkit may require significant auxiliary storage
378
378
(depending on the length of the iterable).
@@ -607,10 +607,10 @@ loops that truncate the stream.
607
607
This function is roughly equivalent to the following code, except that the
608
608
actual implementation does not build up intermediate results in memory::
609
609
610
- def product(*args , repeat=1):
610
+ def product(*iterables , repeat=1):
611
611
# product('ABCD', 'xy') → Ax Ay Bx By Cx Cy Dx Dy
612
612
# product(range(2), repeat=3) → 000 001 010 011 100 101 110 111
613
- pools = [tuple(pool) for pool in args ] * repeat
613
+ pools = [tuple(pool) for pool in iterables ] * repeat
614
614
result = [[]]
615
615
for pool in pools:
616
616
result = [x+[y] for x in result for y in pool]
@@ -727,9 +727,9 @@ loops that truncate the stream.
727
727
iterables are of uneven length, missing values are filled-in with *fillvalue *.
728
728
Iteration continues until the longest iterable is exhausted. Roughly equivalent to::
729
729
730
- def zip_longest(*args , fillvalue=None):
730
+ def zip_longest(*iterables , fillvalue=None):
731
731
# zip_longest('ABCD', 'xy', fillvalue='-') → Ax By C- D-
732
- iterators = [iter(it) for it in args ]
732
+ iterators = [iter(it) for it in iterables ]
733
733
num_active = len(iterators)
734
734
if not num_active:
735
735
return
0 commit comments