From 4eab4a0213ea1a253c646a3f574575f7c0a09fb4 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 9 Feb 2022 10:04:55 -0500 Subject: [PATCH] Type fix --- tractor/trionics/_mngrs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tractor/trionics/_mngrs.py b/tractor/trionics/_mngrs.py index 76f6467..d9e392a 100644 --- a/tractor/trionics/_mngrs.py +++ b/tractor/trionics/_mngrs.py @@ -71,7 +71,7 @@ async def gather_contexts( mngrs: Sequence[AsyncContextManager[T]], -) -> AsyncGenerator[tuple[T, ...], None]: +) -> AsyncGenerator[tuple[Optional[T], ...], None]: ''' Concurrently enter a sequence of async context managers, each in a separate ``trio`` task and deliver the unwrapped values in the @@ -84,7 +84,7 @@ async def gather_contexts( entered and exited cancellation just works. ''' - unwrapped = {}.fromkeys(id(mngr) for mngr in mngrs) + unwrapped: dict[int, Optional[T]] = {}.fromkeys(id(mngr) for mngr in mngrs) all_entered = trio.Event() parent_exit = trio.Event()