From fb8a6b2473ddef246a4c362ceff5d33760a167fb Mon Sep 17 00:00:00 2001 From: goodboy Date: Thu, 11 Jun 2026 15:14:32 -0400 Subject: [PATCH] Use `.wait_for_result()` in dated examples Swap the deprecated `portal.result()` calls for the modern `.wait_for_result()` spelling in, - `a_trynamic_first_scene.py` (x2) - `actor_spawning_and_causality.py` - `parallelism/single_func.py` These 3 are literalinclude'd by the new docs tree so the rendered code must teach the current api; the `debugging/` set still calls `.result()` (pexpect pattern-matched tests, left for a follow-up sweep). (this patch was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- examples/a_trynamic_first_scene.py | 4 ++-- examples/actor_spawning_and_causality.py | 2 +- examples/parallelism/single_func.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/a_trynamic_first_scene.py b/examples/a_trynamic_first_scene.py index 1d531255..05d61ba9 100644 --- a/examples/a_trynamic_first_scene.py +++ b/examples/a_trynamic_first_scene.py @@ -35,8 +35,8 @@ async def main(): name='gretchen', other_actor='donny', ) - print(await gretchen.result()) - print(await donny.result()) + print(await gretchen.wait_for_result()) + print(await donny.wait_for_result()) print("CUTTTT CUUTT CUT!!! Donny!! You're supposed to say...") diff --git a/examples/actor_spawning_and_causality.py b/examples/actor_spawning_and_causality.py index 119726dc..2232ae3e 100644 --- a/examples/actor_spawning_and_causality.py +++ b/examples/actor_spawning_and_causality.py @@ -20,7 +20,7 @@ async def main(): # The ``async with`` will unblock here since the 'some_linguist' # actor has completed its main task ``cellar_door``. - print(await portal.result()) + print(await portal.wait_for_result()) if __name__ == '__main__': diff --git a/examples/parallelism/single_func.py b/examples/parallelism/single_func.py index 8118b024..c4ea29e3 100644 --- a/examples/parallelism/single_func.py +++ b/examples/parallelism/single_func.py @@ -33,7 +33,7 @@ async def main(): await burn_cpu() # wait on result from target function - pid = await portal.result() + pid = await portal.wait_for_result() # end of nursery block print(f"Collected subproc {pid}")