FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-119154: Simplify consumers by making `asyncio.Queue` an asynchronous iterable by nineteendo · Pull Request #120491 · python/cpython · GitHub

Repository navigation

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e9c1a3e
Add `asyncio.Queue.__aiter__()`
nineteendo Jun 14, 2024
3cd59ee
Reduce diff
nineteendo Jun 14, 2024
16fc429
Add test
nineteendo Jun 14, 2024
f13ddb3
Simplify code
nineteendo Jun 14, 2024
afd7ad4
Add to `__all__`
nineteendo Jun 14, 2024
214548c
📜🤖 Added by blurb_it.
blurb-it[bot] Jun 14, 2024
9824b63
Simplify example
nineteendo Jun 14, 2024
6358b8e
Fix indentation
nineteendo Jun 14, 2024
316b800
Improve order
nineteendo Jun 14, 2024
92f3295
Test `StopAsyncIteration`
nineteendo Jun 14, 2024
a18767d
Document `AsyncQueueIterator`
nineteendo Jun 14, 2024
320691c
Apply suggestions from code review
nineteendo Jun 15, 2024
f43bdb1
Unpack for loop
nineteendo Jun 15, 2024
4ca4a93
Insert newline
nineteendo Jun 15, 2024
fffacb2
Simplify example
nineteendo Jun 15, 2024
92d7b16
Indent correctly
nineteendo Jun 15, 2024
ce23fce
Document `__aiter__()`
nineteendo Jun 15, 2024
640d2a8
Fix indent attempt 1
nineteendo Jun 15, 2024
6c9aa6d
Make `AsyncQueueIterator` private
nineteendo Jun 18, 2024
e6a5849
Use term
nineteendo Jun 18, 2024
583f642
Re-order
nineteendo Jun 18, 2024
1b6e781
Remove comment
nineteendo Jun 18, 2024
2d5998a
Update whatsnew
nineteendo Jun 19, 2024
841d50c
Update blurb
nineteendo Jun 19, 2024
d624bea
Apply suggestions from code review
nineteendo Jun 19, 2024
0a8a72b
Update Doc/library/asyncio-queue.rst
nineteendo Jun 19, 2024
b3199df
Rename 2024-06-14-10-30-43.gh-issue-119154.1MHWA-.rst to 2024-06-14-1…
nineteendo Jun 19, 2024
d71eb91
Make queue a private attribute
nineteendo Jun 19, 2024
23e37f4
Clarify behaviour
nineteendo Jun 20, 2024
3bb4e65
Fix grammar
nineteendo Jun 20, 2024
9eff835
Update 2024-06-14-10-30-43.gh-issue-119154.1MHWA-.rst
nineteendo Jun 24, 2024
8580e98
Remove parentheses
nineteendo Jun 24, 2024
670611f
Update Doc/whatsnew/3.14.rst
nineteendo Jun 24, 2024
File filter

Filter by extension

Filter by extension .py  (1) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
  • Loading branch information
nineteendo and Zac-HD authored Jun 15, 2024
commit 320691cd422e5a3f0c323985d5db399a524badcf
2 changes: 1 addition & 1 deletion Doc/library/asyncio-queue.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Async Queue Iterator

.. attribute:: queue

The queue backed by the ``AsyncQueueIterator``.
The queue which backs this ``AsyncQueueIterator``.

.. versionadded:: 3.14

Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_asyncio/test_queues.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ async def worker():
accumulator += item

async with asyncio.TaskGroup() as tg:
tasks = [tg.create_task(worker()) for _ in range(2)]
await asyncio.gather(*tasks, return_exceptions=True)
self.assertEqual(sum(range(100)), accumulator)
tg.create_task(worker())
tg.create_task(worker())
self.assertEqual(sum(range(100)), accumulator)


class QueueGetTests(unittest.IsolatedAsyncioTestCase):
Expand Down

Back | FazBrowse Home | New Git URL