Skip to content

Commit 1501d9b

Browse files
committed
wording
1 parent 0350ce3 commit 1501d9b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

doc/features.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,8 +1946,9 @@ def step2(k): # x0, x0 + 2, x0 + 4, ...
19461946
assert tuple(take(10, unfold1(step2, 10))) == (10, 12, 14, 16, 18, 20, 22, 24, 26, 28)
19471947
19481948
def nextfibo(a, b):
1949-
# First positional is value; everything else is newstate,
1950-
# to be unpacked to `nextfibo`'s args/kwargs at the next iteration.
1949+
# First positional return value is the value to yield.
1950+
# Everything else is newstate, to be unpacked to `nextfibo`'s
1951+
# args/kwargs at the next iteration.
19511952
return Values(a, a=b, b=a + b)
19521953
assert tuple(take(10, unfold(nextfibo, 1, 1))) == (1, 1, 2, 3, 5, 8, 13, 21, 34, 55)
19531954

unpythonic/tests/test_fold.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ def step2(k): # x0, x0 + 2, x0 + 4, ...
183183
return (k, k + 2) # (value, newstate)
184184

185185
def fibo(a, b):
186-
# First positional is value; everything else is newstate,
187-
# to be unpacked to `fibo`'s args/kwargs at the next iteration.
186+
# First positional return value is the value to yield.
187+
# Everything else is newstate, to be unpacked to `fibo`'s
188+
# args/kwargs at the next iteration.
188189
return Values(a, a=b, b=a + b)
189190

190191
def myiterate(f, x): # x0, f(x0), f(f(x0)), ...

0 commit comments

Comments
 (0)