From 0acbb08d08dc859406aa1f6948e06df091346679 Mon Sep 17 00:00:00 2001 From: Yclept Nemo Date: Wed, 16 Aug 2023 17:56:10 -0400 Subject: [PATCH 1/2] asyncio/queues: clarify comments --- Lib/asyncio/queues.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Lib/asyncio/queues.py b/Lib/asyncio/queues.py index a9656a6df561ba..bf8a8f8b5eb08b 100644 --- a/Lib/asyncio/queues.py +++ b/Lib/asyncio/queues.py @@ -128,8 +128,9 @@ async def put(self, item): # previous get_nowait call. pass if not self.full() and not putter.cancelled(): - # We were woken up by get_nowait(), but can't take - # the call. Wake up the next in line. + # We were woken up by get_nowait(), but can't take the + # call. Wake up the next in line. This can happen when + # the putter is set, then the await cancelled. self._wakeup_next(self._putters) raise return self.put_nowait(item) @@ -166,8 +167,9 @@ async def get(self): # previous put_nowait call. pass if not self.empty() and not getter.cancelled(): - # We were woken up by put_nowait(), but can't take - # the call. Wake up the next in line. + # We were woken up by put_nowait(), but can't take the + # call. Wake up the next in line. This can happen when + # the getter is set, then the await cancelled. self._wakeup_next(self._getters) raise return self.get_nowait() From fffcc4706f7e94ea281feead3a623c3cd3c33ec4 Mon Sep 17 00:00:00 2001 From: Yclept Nemo Date: Tue, 19 Sep 2023 14:57:14 -0400 Subject: [PATCH 2/2] Add NEWS blurb --- .../Documentation/2023-09-19-14-55-49.gh-issue-108042.ChCh1e.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Documentation/2023-09-19-14-55-49.gh-issue-108042.ChCh1e.rst diff --git a/Misc/NEWS.d/next/Documentation/2023-09-19-14-55-49.gh-issue-108042.ChCh1e.rst b/Misc/NEWS.d/next/Documentation/2023-09-19-14-55-49.gh-issue-108042.ChCh1e.rst new file mode 100644 index 00000000000000..d4d7278fd98aaa --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2023-09-19-14-55-49.gh-issue-108042.ChCh1e.rst @@ -0,0 +1 @@ +Improve comments in asyncio.queues.Queue.