diff --git a/examples/integration/mpi4py/inherit_parent_main.py b/examples/integration/mpi4py/inherit_parent_main.py index 60e30a95..741d8a6b 100644 --- a/examples/integration/mpi4py/inherit_parent_main.py +++ b/examples/integration/mpi4py/inherit_parent_main.py @@ -33,15 +33,16 @@ async def main() -> None: rank = MPI.COMM_WORLD.Get_rank() print(f"[parent] rank={rank} pid={os.getpid()}", flush=True) + an: tractor.ActorNursery async with tractor.open_nursery(start_method='trio') as an: - portal = await an.start_actor( + portal: tractor.Portal = await an.start_actor( 'mpi-child', enable_modules=[child_fn.__module__], # Without this the child replays __main__, which # re-imports mpi4py and crashes on MPI_Init. inherit_parent_main=False, ) - result = await portal.run(child_fn) + result: str = await portal.run(child_fn) print(f"[parent] got: {result}", flush=True) await portal.cancel_actor() diff --git a/examples/trio/lockacquire_not_unmasked.py b/examples/trio/lockacquire_not_unmasked.py index 2f979a00..19077706 100644 --- a/examples/trio/lockacquire_not_unmasked.py +++ b/examples/trio/lockacquire_not_unmasked.py @@ -32,8 +32,8 @@ async def acquire_singleton_lock( async def hold_lock_forever( - task_status=trio.TASK_STATUS_IGNORED -): + task_status: trio.TaskStatus = trio.TASK_STATUS_IGNORED, +) -> None: async with ( tractor.trionics.maybe_raise_from_masking_exc(), acquire_singleton_lock() as lock, @@ -46,7 +46,7 @@ async def main( ignore_special_cases: bool, loglevel: str = 'info', debug_mode: bool = True, -): +) -> None: async with ( trio.open_nursery() as tn, diff --git a/examples/trio/send_chan_aclose_masks_beg.py b/examples/trio/send_chan_aclose_masks_beg.py index e7f895b7..971d8678 100644 --- a/examples/trio/send_chan_aclose_masks_beg.py +++ b/examples/trio/send_chan_aclose_masks_beg.py @@ -134,7 +134,7 @@ async def main( raise_unmasked: bool = False, loglevel: str = 'info', -): +) -> None: tractor.log.get_console_log(level=loglevel) # the `.aclose()` being checkpoints on these