From 899c720cb77e83531989ced931144aa634d414e5 Mon Sep 17 00:00:00 2001 From: Victor Adossi Date: Mon, 9 Jun 2025 22:23:47 +0900 Subject: [PATCH] fix: output types of Task.yield_ Signed-off-by: Victor Adossi --- design/mvp/CanonicalABI.md | 2 +- design/mvp/canonical-abi/definitions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/design/mvp/CanonicalABI.md b/design/mvp/CanonicalABI.md index 290e8d17..b93363ae 100644 --- a/design/mvp/CanonicalABI.md +++ b/design/mvp/CanonicalABI.md @@ -933,7 +933,7 @@ external I/O. This is emulated in the Python code below by waiting on an immediately-resolved future, which calls the `OnBlock` callback, which allows control flow to switch to other `asyncio.Task`s. ```python - async def yield_(self, sync) -> bool: + async def yield_(self, sync) -> EventTuple: if self.state == Task.State.PENDING_CANCEL: self.state = Task.State.CANCEL_DELIVERED return (EventCode.TASK_CANCELLED, 0, 0) diff --git a/design/mvp/canonical-abi/definitions.py b/design/mvp/canonical-abi/definitions.py index 588d65e6..118c5bd7 100644 --- a/design/mvp/canonical-abi/definitions.py +++ b/design/mvp/canonical-abi/definitions.py @@ -587,7 +587,7 @@ async def wait_for_event(self, waitable_set, sync) -> EventTuple: waitable_set.num_waiting -= 1 return e - async def yield_(self, sync) -> bool: + async def yield_(self, sync) -> EventTuple: if self.state == Task.State.PENDING_CANCEL: self.state = Task.State.CANCEL_DELIVERED return (EventCode.TASK_CANCELLED, 0, 0)