From 3bd50476794be3aa690545f3a06a1a2c800d0821 Mon Sep 17 00:00:00 2001 From: Asif Rahman Date: Sat, 7 Dec 2024 08:47:32 -0500 Subject: [PATCH] Fix docstring example in _main.py from .pending to .ready The docstring incorrectly gave an example like `if not result1.pending` but SoonValue does not have a a pending attribute. The example should check `if result1.ready` instead. --- asyncer/_main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asyncer/_main.py b/asyncer/_main.py index 78117e4..8c223f8 100644 --- a/asyncer/_main.py +++ b/asyncer/_main.py @@ -136,9 +136,9 @@ async def do_work(name: str) -> str: result1 = task_group.soonify(do_work)(name="task 1") result2 = task_group.soonify(do_work)(name="task 2") await anyio.sleep(0) - if not result1.pending: + if result1.ready: print(result1.value) - if not result2.pending: + if result2.ready: print(result2.value) ```