Skip to content

Commit de84ea6

Browse files
committed
be extra explicit that you have to wrap a generator
1 parent 905020c commit de84ea6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

effect/do.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ def foo():
2727
eff = foo()
2828
return eff.on(...)
2929
30-
``@do`` must decorate a generator function. Any yielded values must either
31-
be Effects or the result of a :func:`do_return` call. The result of a
32-
yielded Effect will be passed back into the generator as the result of the
33-
``yield`` expression. Yielded :func:`do_return` values will provide the
34-
ultimate result of the Effect that is returned by the decorated function.
30+
``@do`` must decorate a generator function (not any other type of
31+
iterator). Any yielded values must either be Effects or the result of a
32+
:func:`do_return` call. The result of a yielded Effect will be passed back
33+
into the generator as the result of the ``yield`` expression. Yielded
34+
:func:`do_return` values will provide the ultimate result of the Effect
35+
that is returned by the decorated function.
3536
3637
It's important to note that any generator function decorated by ``@do``
3738
will no longer return a generator, but instead it will return an Effect,

0 commit comments

Comments
 (0)