From e44c8ba83ea2dafc32ac804270d4e0ba72fbba9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 29 Sep 2019 03:35:25 +0200 Subject: [PATCH] Coroutine --- README.md | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c55e355..70be1fb 100644 --- a/README.md +++ b/README.md @@ -2211,7 +2211,7 @@ Coroutine ### Helper Decorator * **All coroutines must first be "primed" by calling `'next()'`.** * **Remembering to call next() is easy to forget.** -* **Solved by wrapping functions that return a coroutine with a decorator:** +* **Solved by wrapping coroutine functions with a following decorator:** ```python def coroutine(func): diff --git a/index.html b/index.html index ebc63bc..d7d12e7 100644 --- a/index.html +++ b/index.html @@ -1915,7 +1915,7 @@ ValueError: malformed node or string

Helper Decorator

  • All coroutines must first be "primed" by calling 'next(<coroutine>)'.
  • Remembering to call next() is easy to forget.
  • -
  • Solved by wrapping functions that return a coroutine with a decorator:
  • +
  • Solved by wrapping coroutine functions with a following decorator:
def coroutine(func):
     def out(*args, **kwargs):
         cr = func(*args, **kwargs)