diff --git a/examples/example_interrupt.py b/examples/example_interrupt.py index aef0b64..a0faf81 100644 --- a/examples/example_interrupt.py +++ b/examples/example_interrupt.py @@ -23,7 +23,7 @@ class Interrupt(Exception): async def test_stop_doing_that(): """ - This example shows how we can use task_interrup() + This example shows how we can use task_interrupt() to immediately send an exception to a task in a certain state, and know how it has got the interrupt delivered by the time we have awaited. diff --git a/examples/example_resp.py b/examples/example_resp.py index 29a4245..22df2ee 100644 --- a/examples/example_resp.py +++ b/examples/example_resp.py @@ -66,7 +66,7 @@ def test_generator() -> None: """ Test our generator based parser for Redis RESP strings. """ - # construct a resp string constisting of an array of arrays of ints + # construct a resp string consisting of an array of arrays of ints resp = b"*2\r\n*3\r\n:1\r\n:2\r\n:3\r\n*2\r\n:4\r\n:5\r\n" # split it up into chunks of two bytes chunks = [resp[i : i + 2] for i in range(0, len(resp), 2)] @@ -115,7 +115,7 @@ async def parse_resp_mon( async def test_monitor() -> None: """Test our monitor based parser for Redis RESP strings.""" - # construct a resp string constisting of an array of arrays of ints + # construct a resp string consisting of an array of arrays of ints resp = b"*2\r\n*3\r\n:1\r\n:2\r\n:3\r\n*2\r\n:4\r\n:5\r\n" # split it up into chunks of two bytes chunks = [resp[i : i + 2] for i in range(0, len(resp), 2)] @@ -137,7 +137,7 @@ def test_monitor_sync() -> None: """Test our monitor based parser for Redis RESP strings. from synchronous code. """ - # construct a resp string constisting of an array of arrays of ints + # construct a resp string consisting of an array of arrays of ints resp = b"*2\r\n*3\r\n:1\r\n:2\r\n:3\r\n*2\r\n:4\r\n:5\r\n" # split it up into chunks of two bytes chunks = [resp[i : i + 2] for i in range(0, len(resp), 2)] diff --git a/src/asynkit/coroutine.py b/src/asynkit/coroutine.py index a245a92..e37f1a6 100644 --- a/src/asynkit/coroutine.py +++ b/src/asynkit/coroutine.py @@ -184,11 +184,11 @@ def _start(self) -> Tuple[Any, Optional[BaseException]]: def __await__(self) -> Generator[Any, Any, T_co]: """ - Resume the excecution of the started coroutine. CoroStart is an + Resume the execution of the started coroutine. CoroStart is an _awaitable_. """ if self.start_result is None: - # exhausted coroutine, triger the "cannot reuse" error + # exhausted coroutine, trigger the "cannot reuse" error self.coro.send(None) assert False, "unreachable" @@ -280,7 +280,7 @@ def throw( def close(self) -> None: """ - Close the coroutine. It must immediatly exit. + Close the coroutine. It must immediately exit. """ self.start_result = None self.coro.close() @@ -500,7 +500,7 @@ def wrapper(self: S) -> Iterator[T]: def await_sync(coro: Coroutine[Any, Any, T]) -> T: - """Runs a corouting synchronlously. If the coroutine blocks, a + """Runs a coroutine synchronously. If the coroutine blocks, a SynchronousError is raised. """ start = CoroStart[T](coro) @@ -546,7 +546,7 @@ async def helper(*args: P.args, **kwargs: P.kwargs) -> T: def aiter_sync(async_iterable: AsyncIterable[T]) -> Generator[T, None, None]: - """Iterate synchronously over an async itarable""" + """Iterate synchronously over an async iterable""" ai = async_iterable.__aiter__() # a helper ensures that we have a coroutine, not just an Awaitable diff --git a/src/asynkit/monitor.py b/src/asynkit/monitor.py index a16b9d3..3b47d5b 100644 --- a/src/asynkit/monitor.py +++ b/src/asynkit/monitor.py @@ -219,7 +219,7 @@ async def try_await( sentinel: Any = None, ) -> Any: """ - A convenence function to call `aawait()`, returning a sentinel if + A convenience function to call `aawait()`, returning a sentinel if an OOBData exception was raised. The `sentinel` value defaults to None. The OOBData exception is discarded. @@ -233,7 +233,7 @@ async def try_await( class BoundMonitor(Generic[T]): """ An awaitable helper class which can be awaited to invoke a - `await Monitior.aawait(coroutine)` + `await Monitor.aawait(coroutine)` """ def __init__(self, monitor: Monitor[T], coro: Coroutine[Any, Any, T]) -> None: