We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 753331a commit 46ecf2bCopy full SHA for 46ecf2b
toolz/functoolz.py
@@ -839,7 +839,7 @@ def unfold(func, x):
839
... return (x * 2, x + 1)
840
...
841
>>> list(unfold(doubles, 1))
842
- [2, 4, 6, 9, 10, 12, 14, 16, 18, 20]
+ [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
843
844
If ``x`` has type ``A`` and the generator yields values of type ``B``,
845
then ``func`` has type ``Callable[[A], Optional[Tuple[B, A]]]``.
@@ -865,7 +865,7 @@ def unfold_(predicate, func, succ, x):
865
>>> double = lambda x: x * 2
866
>>> inc = lambda x: x + 1
867
>>> list(unfold(lte10, double, inc, 1))
868
869
870
871
then ``predicate`` has type ``Callable[[A], bool]``, ``func`` has type
0 commit comments