René's URL Explorer Experiment


Title: GH-98363: Presize the list for batched() by rhettinger · Pull Request #98419 · python/cpython · GitHub

Open Graph Title: GH-98363: Presize the list for batched() by rhettinger · Pull Request #98419 · python/cpython

X Title: GH-98363: Presize the list for batched() by rhettinger · Pull Request #98419 · python/cpython

Description: Presizing the result lists saves space from list over-allocation and is faster than the PyList_Append() approach. This is a short PR but it took a while to figure out that PyList_GetSlice() would m...

Open Graph Description: Presizing the result lists saves space from list over-allocation and is faster than the PyList_Append() approach. This is a short PR but it took a while to figure out that PyList_GetSlice() would m...

X Description: Presizing the result lists saves space from list over-allocation and is faster than the PyList_Append() approach. This is a short PR but it took a while to figure out that PyList_GetSlice() would m...

Opengraph URL: https://github.com/python/cpython/pull/98419

X: @github

direct link

Domain: github.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:52f9a9b8-68e4-eb0c-e387-61c57f073338
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id965E:3244AB:205DE9:2BA3EA:696977F6
html-safe-nonce38a3fb45ade286cb6dad3e1599375bd59bd356469a0cea85624092c3f7dcf74a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjVFOjMyNDRBQjoyMDVERTk6MkJBM0VBOjY5Njk3N0Y2IiwidmlzaXRvcl9pZCI6IjYzNjIxOTU2NzY1MDE3MzU0MTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac120427d87f1c9abf0e734e31c7f33dbe971f811ea99f11951411f3217dc25666
hovercard-subject-tagpull_request:1091437032
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/cpython/98419/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/ae93ea6e1710933c5c88911bc0ff07e7e35efe1b6f03b6e4718a1f12f6e35824/python/cpython/pull/98419
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ae93ea6e1710933c5c88911bc0ff07e7e35efe1b6f03b6e4718a1f12f6e35824/python/cpython/pull/98419
og:image:altPresizing the result lists saves space from list over-allocation and is faster than the PyList_Append() approach. This is a short PR but it took a while to figure out that PyList_GetSlice() would m...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerhettinger
hostnamegithub.com
expected-hostnamegithub.com
Nonec6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release212e3e3d3298bf5b313830edfd2399e869f7ea76
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/98419#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F98419
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F98419
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%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/98419
Reloadhttps://github.com/python/cpython/pull/98419
Reloadhttps://github.com/python/cpython/pull/98419
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/98419
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/98419
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
Jump to bottomhttps://github.com/python/cpython/pull/98419#issue-comment-box
rhettingerhttps://github.com/rhettinger
python:mainhttps://github.com/python/cpython/tree/main
rhettinger:better_batchedhttps://github.com/rhettinger/cpython/tree/better_batched
GH-98363: Presize the list for batched() https://github.com/python/cpython/pull/98419#top
rhettingerhttps://github.com/rhettinger
python:mainhttps://github.com/python/cpython/tree/main
rhettinger:better_batchedhttps://github.com/rhettinger/cpython/tree/better_batched
Conversation 6 https://github.com/python/cpython/pull/98419
Commits 6 https://github.com/python/cpython/pull/98419/commits
Checks 0 https://github.com/python/cpython/pull/98419/checks
Files changed https://github.com/python/cpython/pull/98419/files
Please reload this pagehttps://github.com/python/cpython/pull/98419
https://github.co/hiddenchars
https://github.com/python/cpython/pull/{{ revealButtonHref }}
https://github.com/rhettinger
rhettingerhttps://github.com/rhettinger
Oct 18, 2022https://github.com/python/cpython/pull/98419#issue-1413952919
Please reload this pagehttps://github.com/python/cpython/pull/98419
Add itertools.batched() #98363https://github.com/python/cpython/issues/98363
Please reload this pagehttps://github.com/python/cpython/pull/98419
https://github.com/rhettinger
Presize the list for batched()https://github.com/python/cpython/pull/98419/commits/ea9511e781dea7b25d8929332534afefdb6dadcd
ea9511ehttps://github.com/python/cpython/pull/98419/commits/ea9511e781dea7b25d8929332534afefdb6dadcd
https://github.com/rhettinger
rhettingerhttps://github.com/rhettinger
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
skip news https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
Oct 18, 2022https://github.com/python/cpython/pull/98419#event-7616039368
https://github.com/rhettinger
rhettingerhttps://github.com/rhettinger
sweeneydehttps://github.com/sweeneyde
October 18, 2022 23:09https://github.com/python/cpython/pull/98419#event-7616039379
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Oct 18, 2022https://github.com/python/cpython/pull/98419#event-7616039596
rhettingerhttps://github.com/rhettinger
October 18, 2022 19:29https://github.com/python/cpython/pull/98419#commits-pushed-88fc1b1
https://github.com/rhettinger
Fast path for the common case (zero new items).https://github.com/python/cpython/pull/98419/commits/88fc1b105a465370c1eee0e6e2a431a612e33059
88fc1b1https://github.com/python/cpython/pull/98419/commits/88fc1b105a465370c1eee0e6e2a431a612e33059
https://github.com/rhettinger
Cleaner handling of empty resulthttps://github.com/python/cpython/pull/98419/commits/0e05aa486104ca6639e43f7e93fca7708696dacc
0e05aa4https://github.com/python/cpython/pull/98419/commits/0e05aa486104ca6639e43f7e93fca7708696dacc
https://github.com/rhettinger
Let NULL error flow through the returnhttps://github.com/python/cpython/pull/98419/commits/646630efe3f69ef626d263162de684f1b0e6f7a2
646630ehttps://github.com/python/cpython/pull/98419/commits/646630efe3f69ef626d263162de684f1b0e6f7a2
https://github.com/rhettinger
Use n variable consistently throughouthttps://github.com/python/cpython/pull/98419/commits/5e38c096ff98b319c4f45a3d857f8187f0aa98a2
5e38c09https://github.com/python/cpython/pull/98419/commits/5e38c096ff98b319c4f45a3d857f8187f0aa98a2
https://github.com/rhettinger
Remove spurious include directivehttps://github.com/python/cpython/pull/98419/commits/fd5b50871810e8228d6596d7681beb883d9ecebd
fd5b508https://github.com/python/cpython/pull/98419/commits/fd5b50871810e8228d6596d7681beb883d9ecebd
https://github.com/rhettinger
rhettingerhttps://github.com/rhettinger
🔨 test-with-buildbots https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22%3Ahammer%3A%20test-with-buildbots%22
Oct 19, 2022https://github.com/python/cpython/pull/98419#event-7616630928
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
Oct 19, 2022https://github.com/python/cpython/pull/98419#issuecomment-1283228588
@rhettingerhttps://github.com/rhettinger
fd5b508https://github.com/python/cpython/commit/fd5b50871810e8228d6596d7681beb883d9ecebd
Please reload this pagehttps://github.com/python/cpython/pull/98419
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
🔨 test-with-buildbots https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22%3Ahammer%3A%20test-with-buildbots%22
Oct 19, 2022https://github.com/python/cpython/pull/98419#event-7616631163
https://github.com/sweeneyde
sweeneydehttps://github.com/sweeneyde
Oct 20, 2022 https://github.com/python/cpython/pull/98419#pullrequestreview-1148458192
View reviewed changes https://github.com/python/cpython/pull/98419/files/fd5b50871810e8228d6596d7681beb883d9ecebd
Modules/itertoolsmodule.chttps://github.com/python/cpython/pull/98419/files/fd5b50871810e8228d6596d7681beb883d9ecebd#diff-dc27cbdf2b9f6e5236cade13cf301d352a7abd2a8b1988f2517d6f5b7a30c201
sweeneydehttps://github.com/sweeneyde
Oct 20, 2022https://github.com/python/cpython/pull/98419#discussion_r1000074109
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/98419
rhettingerhttps://github.com/rhettinger
Oct 20, 2022https://github.com/python/cpython/pull/98419#discussion_r1000128530
Please reload this pagehttps://github.com/python/cpython/pull/98419
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/98419
sweeneydehttps://github.com/sweeneyde
Oct 20, 2022https://github.com/python/cpython/pull/98419#discussion_r1000188986
Please reload this pagehttps://github.com/python/cpython/pull/98419
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/98419
https://github.com/sweeneyde
sweeneydehttps://github.com/sweeneyde
Oct 20, 2022 https://github.com/python/cpython/pull/98419#pullrequestreview-1148623982
View reviewed changes https://github.com/python/cpython/pull/98419/files/fd5b50871810e8228d6596d7681beb883d9ecebd
sweeneydehttps://github.com/sweeneyde
https://github.com/python/cpython/pull/98419#pullrequestreview-1148623982
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/98419
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
awaiting core review https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20core%20review%22
Oct 20, 2022https://github.com/python/cpython/pull/98419#event-7627729868
https://github.com/rhettinger
rhettingerhttps://github.com/rhettinger
c1e02d4https://github.com/python/cpython/commit/c1e02d4e4e09dfc9d57c4d36eca1bbf312d4162d
Oct 20, 2022https://github.com/python/cpython/pull/98419#event-7628119771
https://github.com/bedevere-bot
bedevere-bothttps://github.com/bedevere-bot
awaiting merge https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22awaiting%20merge%22
Oct 20, 2022https://github.com/python/cpython/pull/98419#event-7628120203
https://github.com/rhettinger
rhettingerhttps://github.com/rhettinger
Oct 20, 2022https://github.com/python/cpython/pull/98419#issuecomment-1285074797
Please reload this pagehttps://github.com/python/cpython/pull/98419
Please reload this pagehttps://github.com/python/cpython/pull/98419
carljmhttps://github.com/carljm
Oct 20, 2022 https://github.com/python/cpython/pull/98419#ref-commit-8bba5da
https://github.com/carljm
Merge branch 'main' into typewatchhttps://github.com/carljm/cpython/commit/8bba5da3257ff3464b4d5e5913ebe3ac86644fd8
8bba5dahttps://github.com/carljm/cpython/commit/8bba5da3257ff3464b4d5e5913ebe3ac86644fd8
pythongh-98461https://github.com/python/cpython/issues/98461
pythonGH-98464https://github.com/python/cpython/pull/98464
pythongh-98421https://github.com/python/cpython/issues/98421
pythonGH-98422https://github.com/python/cpython/pull/98422
pythongh-98360https://github.com/python/cpython/issues/98360
pythonGH-98462https://github.com/python/cpython/pull/98462
python#98480https://github.com/python/cpython/pull/98480
pythonGH-98481https://github.com/python/cpython/pull/98481
pythonGH-98475https://github.com/python/cpython/pull/98475
pythongh-95023https://github.com/python/cpython/issues/95023
python#95046https://github.com/python/cpython/pull/95046
pythonGH-98363https://github.com/python/cpython/issues/98363
pythonGH-98419https://github.com/python/cpython/pull/98419
pythongh-98374https://github.com/python/cpython/issues/98374
pythongh-98450https://github.com/python/cpython/pull/98450
python#98351https://github.com/python/cpython/pull/98351
pythongh-98354https://github.com/python/cpython/issues/98354
pythonGH-98412https://github.com/python/cpython/pull/98412
pythongh-98257https://github.com/python/cpython/issues/98257
python#98258https://github.com/python/cpython/pull/98258
pythongh-98414https://github.com/python/cpython/issues/98414
pythonGH-98460https://github.com/python/cpython/pull/98460
pythongh-98417https://github.com/python/cpython/issues/98417
pythonGH-98418https://github.com/python/cpython/pull/98418
python#98409https://github.com/python/cpython/pull/98409
pythonGH-98350https://github.com/python/cpython/pull/98350
python#98441https://github.com/python/cpython/pull/98441
pythongh-92886https://github.com/python/cpython/issues/92886
pythonGH-93231https://github.com/python/cpython/pull/93231
pythongh-92886https://github.com/python/cpython/issues/92886
pythonGH-93233https://github.com/python/cpython/pull/93233
pythongh-92886https://github.com/python/cpython/issues/92886
pythonGH-93235https://github.com/python/cpython/pull/93235
https://github.com/rhettinger
rhettingerhttps://github.com/rhettinger
October 20, 2022 21:38https://github.com/python/cpython/pull/98419#event-7635210410
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F98419
https://github.com/sweeneyde
sweeneyde https://github.com/sweeneyde
https://github.com/python/cpython/pull/98419/files/fd5b50871810e8228d6596d7681beb883d9ecebd
performance https://github.com/python/cpython/issues?q=state%3Aopen%20label%3Aperformance
skip news https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22skip%20news%22
Please reload this pagehttps://github.com/python/cpython/pull/98419
https://github.com/rhettinger
https://github.com/bedevere-bot
https://github.com/sweeneyde
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.