| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:232ff8f2-1e5b-17cf-ac7a-558197b6811c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E04E:240CD1:4837D40:5B99A45:6B024A8B |
| html-safe-nonce | ae4f254157411488c1695997338f801c6300d31949dd573522755914ac99c6ff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDRFOjI0MENEMTo0ODM3RDQwOjVCOTlBNDU6NkIwMjRBOEIiLCJ2aXNpdG9yX2lkIjoiMjQ4MjE2ODk0MTk3NjM3Mzg5OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fc2928dd3899c88929631a7321829cad6c1c0a25ff79b47b78542f6c3ae8e8e7 |
| hovercard-subject-tag | pull_request:1920711916 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/120503/files |
| twitter:image | https://avatars.githubusercontent.com/u/65588599?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/65588599?s=400&v=4 |
| og:image:alt | Purpose
Currently consuming items from a queue is very complex. You need to
use an infinite while loop
check for a sentinel
call q.task_done() after processing each item
join the queue
cancel all ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/python/cpython/pull/120503/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F120503%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F120503%2Ffiles |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython |
| Reload | https://github.com/python/cpython/pull/120503/files |
| Reload | https://github.com/python/cpython/pull/120503/files |
| Reload | https://github.com/python/cpython/pull/120503/files |
| python | https://github.com/python |
| cpython | https://github.com/python/cpython |
| Code | https://github.com/python/cpython |
| Issues5k+ (5k+) | https://github.com/python/cpython/issues |
| Pull requests2.4k (2.4k) | https://github.com/python/cpython/pulls |
| Actions | https://github.com/python/cpython/actions |
| Projects | https://github.com/python/cpython/projects |
| Security and quality | https://github.com/python/cpython/security |
| Insights | https://github.com/python/cpython/insights |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| nineteendo | https://github.com/nineteendo |
| python:main | https://github.com/python/cpython/tree/main |
| nineteendo:add-Queue.__iter__ | https://github.com/nineteendo/cpython/tree/add-Queue.__iter__ |
|
Conversation
19
| https://github.com/python/cpython/pull/120503 |
|
Commits
27
| https://github.com/python/cpython/pull/120503/commits |
|
Checks
0
| https://github.com/python/cpython/pull/120503/checks |
|
Files changed
| https://github.com/python/cpython/pull/120503/files |
| Please reload this page | https://github.com/python/cpython/pull/120503/files |
|
gh-119154: Simplify consumers by making queue.Queue an iterable
| https://github.com/python/cpython/pull/120503/files#top |
|
Show all changes
27 commits
| https://github.com/python/cpython/pull/120503/files |
|
e826a01
Add `queue.Queue.__iter__()`
nineteendo Jun 14, 2024
| https://github.com/python/cpython/pull/120503/commits/e826a01248a840f05182c97536f85e089ec584cf |
|
c8cbe4d
Add `asyncio.Queue.__iter__()`
nineteendo Jun 14, 2024
| https://github.com/python/cpython/pull/120503/commits/c8cbe4d0b1a48d31bfaa2dba3f3874c679a02dbe |
|
940e3c0
📜🤖 Added by blurb_it.
blurb-it[bot] Jun 14, 2024
| https://github.com/python/cpython/pull/120503/commits/940e3c0ee41835d62771bfaf00dfc3168ea1206c |
|
8fca288
Fix lint
nineteendo Jun 14, 2024
| https://github.com/python/cpython/pull/120503/commits/8fca2888da1ae26bf442723b922617be76b2f1e2 |
|
499457c
Wait
nineteendo Jun 14, 2024
| https://github.com/python/cpython/pull/120503/commits/499457c1993c69f6cf7ff33ac94dcf082fc6b039 |
|
7f206d9
Update 2024-06-14-13-37-45.gh-issue-120499.JK7Mv8.rst
nineteendo Jun 14, 2024
| https://github.com/python/cpython/pull/120503/commits/7f206d98a7928a4531a84082d5874e8b6296d0f6 |
|
3cad181
Move while loop inside try/except block
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/3cad1810cbe41fd88c1e8ce5244d152b5156e028 |
|
cc9f7ef
test iteration
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/cc9f7ef91dd4d89165ba8410a6ad144e222915b2 |
|
92d7dc0
Reduce diff
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/92d7dc025519c526caa92c4bf8a851db5ffcd884 |
|
a92e031
Run test
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/a92e0318f86d017b831aabf58def4b1feb3fd861 |
|
3621cc1
Reduce diff
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/3621cc169d06928f11870944d72089dceb533638 |
|
98252c6
Adapt example from asyncio
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/98252c6e925d85fc988cd19b51621d3d478b0970 |
|
4b1ff4b
Simpler example
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/4b1ff4ba47578fdb68e91b6a05325a00ddbd78c3 |
|
5e9f48b
Put definition first
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/5e9f48b76d5d652447761601833b5ad61ed61760 |
|
4b382ec
Print worker name
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/4b382ec300702fe85a60f49ab5e78e98df8bd360 |
|
076a7a6
Restore example
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/076a7a617f5c62d558f364453003a95e51c05bf5 |
|
6132f5a
Indent example
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/6132f5a854eb3caa771f6fc66aa1d0f9262fd59b |
|
9a28bc5
Cleanup tests
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/9a28bc508f5afb28946c40b7581ff3c54afc9102 |
|
0a69fd9
Instantiate
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/0a69fd9752bc02aa11ac6a65b6cd8a22cd486b1c |
|
4407eed
Move inside with block
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/4407eedd34f008d08b64377594a24f1d871422bc |
|
1e500ab
Add comment
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/1e500abcd7aa2e4c2636d67846c4550eba75fd6a |
|
101409f
Separate function definition
nineteendo Jun 18, 2024
| https://github.com/python/cpython/pull/120503/commits/101409f316e6fd93ccfa139336eaa0a0857b6ef8 |
|
bcdb21f
Update whatsnew
nineteendo Jun 19, 2024
| https://github.com/python/cpython/pull/120503/commits/bcdb21ff04df988175b9d4edc53ae22c2a00d4c3 |
|
0743257
Update blurb
nineteendo Jun 19, 2024
| https://github.com/python/cpython/pull/120503/commits/0743257f2dba19d6b163124361da3ff9f0a1ac52 |
|
5e37cd5
Rename 2024-06-14-13-37-45.gh-issue-120499.JK7Mv8.rst to 2024-06-14-1…
nineteendo Jun 19, 2024
| https://github.com/python/cpython/pull/120503/commits/5e37cd5ea45504c870e192e77312bf3b17c446d9 |
|
1f05869
Merge branch 'main' into add-Queue.__iter__
nineteendo Jun 19, 2024
| https://github.com/python/cpython/pull/120503/commits/1f058690c5c5d45acc6c55d1127a5ae78719778b |
|
b23a1b3
Clarify documentation
nineteendo Jun 21, 2024
| https://github.com/python/cpython/pull/120503/commits/b23a1b326791edd0b4310867c12bce008e7b2656 |
|
Clear filters
| https://github.com/python/cpython/pull/120503/files |
| Please reload this page | https://github.com/python/cpython/pull/120503/files |
| Please reload this page | https://github.com/python/cpython/pull/120503/files |
|
queue.rst
| https://github.com/python/cpython/pull/120503/files#diff-5f8aec8fa45976df3a34d74ef406e3c373a0e02a978dd5d8c8d824a6783eafef |
|
3.14.rst
| https://github.com/python/cpython/pull/120503/files#diff-24e6cbe61d91e61059c44a7cf5f712499a11eb47a82d5f1a8db16ec7f9023c31 |
|
queue.py
| https://github.com/python/cpython/pull/120503/files#diff-aefad8744bccb805db2835af233fae516b8824a1e4d20b2545a640278c69620d |
|
test_queue.py
| https://github.com/python/cpython/pull/120503/files#diff-aa2555f5532a7deb4b049d0b1f6b45f79bdcc9e4479548d930c09b2720fe0181 |
|
2024-06-14-13-37-45.gh-issue-120499.JK7Mv8.rst
| https://github.com/python/cpython/pull/120503/files#diff-1b963fcfc782c9467a05d2db1ea724c004f5ecd4ea08506f15a6f99719f7fb5d |
| Doc/library/queue.rst | https://github.com/python/cpython/pull/120503/files#diff-5f8aec8fa45976df3a34d74ef406e3c373a0e02a978dd5d8c8d824a6783eafef |
|
View file
| https://github.com/nineteendo/cpython/blob/b23a1b326791edd0b4310867c12bce008e7b2656/Doc/library/queue.rst |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/120503/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/120503/files#diff-5f8aec8fa45976df3a34d74ef406e3c373a0e02a978dd5d8c8d824a6783eafef |
|
| https://github.com/python/cpython/pull/120503/files#diff-5f8aec8fa45976df3a34d74ef406e3c373a0e02a978dd5d8c8d824a6783eafef |
|
| https://github.com/python/cpython/pull/120503/files#diff-5f8aec8fa45976df3a34d74ef406e3c373a0e02a978dd5d8c8d824a6783eafef |
|
| https://github.com/python/cpython/pull/120503/files#diff-5f8aec8fa45976df3a34d74ef406e3c373a0e02a978dd5d8c8d824a6783eafef |
|
| https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L116 |
| Doc/whatsnew/3.14.rst | https://github.com/python/cpython/pull/120503/files#diff-24e6cbe61d91e61059c44a7cf5f712499a11eb47a82d5f1a8db16ec7f9023c31 |
|
View file
| https://github.com/nineteendo/cpython/blob/b23a1b326791edd0b4310867c12bce008e7b2656/Doc/whatsnew/3.14.rst |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/120503/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/120503/files#diff-24e6cbe61d91e61059c44a7cf5f712499a11eb47a82d5f1a8db16ec7f9023c31 |
|
| https://github.com/python/cpython/pull/120503/files#diff-24e6cbe61d91e61059c44a7cf5f712499a11eb47a82d5f1a8db16ec7f9023c31 |
| Lib/queue.py | https://github.com/python/cpython/pull/120503/files#diff-aefad8744bccb805db2835af233fae516b8824a1e4d20b2545a640278c69620d |
|
View file
| https://github.com/nineteendo/cpython/blob/b23a1b326791edd0b4310867c12bce008e7b2656/Lib/queue.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/120503/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/120503/files#diff-aefad8744bccb805db2835af233fae516b8824a1e4d20b2545a640278c69620d |
|
| https://github.com/python/cpython/pull/120503/files#diff-aefad8744bccb805db2835af233fae516b8824a1e4d20b2545a640278c69620d |
| Lib/test/test_queue.py | https://github.com/python/cpython/pull/120503/files#diff-aa2555f5532a7deb4b049d0b1f6b45f79bdcc9e4479548d930c09b2720fe0181 |
|
View file
| https://github.com/nineteendo/cpython/blob/b23a1b326791edd0b4310867c12bce008e7b2656/Lib/test/test_queue.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/120503/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/120503/files#diff-aa2555f5532a7deb4b049d0b1f6b45f79bdcc9e4479548d930c09b2720fe0181 |
|
| https://github.com/python/cpython/pull/120503/files#diff-aa2555f5532a7deb4b049d0b1f6b45f79bdcc9e4479548d930c09b2720fe0181 |
|
| https://github.com/python/cpython/pull/120503/files#diff-aa2555f5532a7deb4b049d0b1f6b45f79bdcc9e4479548d930c09b2720fe0181 |
|
| https://github.com/python/cpython/pull/120503/files#diff-aa2555f5532a7deb4b049d0b1f6b45f79bdcc9e4479548d930c09b2720fe0181 |
| Misc/NEWS.d/next/Library/2024-06-14-13-37-45.gh-issue-120499.JK7Mv8.rst | https://github.com/python/cpython/pull/120503/files#diff-1b963fcfc782c9467a05d2db1ea724c004f5ecd4ea08506f15a6f99719f7fb5d |
|
View file
| https://github.com/nineteendo/cpython/blob/b23a1b326791edd0b4310867c12bce008e7b2656/Misc/NEWS.d/next/Library/2024-06-14-13-37-45.gh-issue-120499.JK7Mv8.rst |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/120503/{{ revealButtonHref }} |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |