| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a019972e-6dfd-0613-3d7d-6704e0a997dc |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9732:2C2C4D:101C70:168FA8:696A6D8B |
| html-safe-nonce | 2f9960becd89ed0b10de71d2b853cc241370d80893f55765be8f7d2108cbe440 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzMyOjJDMkM0RDoxMDFDNzA6MTY4RkE4OjY5NkE2RDhCIiwidmlzaXRvcl9pZCI6Ijc4NDM0NDY5NDgxODg4MTA2MzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d204726cbbf1f74c424601b79e1e0cd87aac3c9e9c7203b3997cea613e1a392c |
| hovercard-subject-tag | pull_request:597408477 |
| 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/24954/files |
| twitter:image | https://avatars.githubusercontent.com/u/122251?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/122251?s=400&v=4 |
| og:image:alt | Before v3.9, list literals weren't over-allocated, but this behavior regressed starting with v3.9:
Switched to initializing list literals w/ LIST_EXTEND
https://bugs.python.org/issue39320
#1798... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6fea32d5b7276b841b7a803796d9715bc6cfb31ed549fdf9de2948ac25d12ba6 |
| 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 | f2d9f6432a5a115ec709295ae70623f33bb80aee |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/python/cpython/pull/24954/files#start-of-content |
|
| https://github.com/ |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F24954%2Ffiles |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub SparkBuild and deploy intelligent apps | https://github.com/features/spark |
| GitHub ModelsManage and compare prompts | https://github.com/features/models |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| 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 |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| GitHub SponsorsFund open source developers | https://github.com/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/accelerator |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | 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/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://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%2F24954%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/24954/files |
| Reload | https://github.com/python/cpython/pull/24954/files |
| Reload | https://github.com/python/cpython/pull/24954/files |
|
python
| https://github.com/python |
| cpython | https://github.com/python/cpython |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
|
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 page | https://github.com/python/cpython/pull/24954/files |
|
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 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 |
| chadnetzer | https://github.com/chadnetzer |
| python:main | https://github.com/python/cpython/tree/main |
| chadnetzer:bpo43574-dont-overallocate-list-literals | https://github.com/chadnetzer/cpython/tree/bpo43574-dont-overallocate-list-literals |
|
Conversation
33
| https://github.com/python/cpython/pull/24954 |
|
Commits
11
| https://github.com/python/cpython/pull/24954/commits |
|
Checks
0
| https://github.com/python/cpython/pull/24954/checks |
|
Files changed
| https://github.com/python/cpython/pull/24954/files |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
|
bpo-43574: Dont overallocate list literals
| https://github.com/python/cpython/pull/24954/files#top |
|
Show all changes
11 commits
| https://github.com/python/cpython/pull/24954/files |
|
4dbee9a
Add testcase for bpo-43574 list overallocaton
chadnetzer Mar 21, 2021
| https://github.com/python/cpython/pull/24954/commits/4dbee9ad373de2948503d8e053c337f792286ef4 |
|
5b31470
Don't overallocate when extending an empty list
chadnetzer Mar 21, 2021
| https://github.com/python/cpython/pull/24954/commits/5b31470b03dcabd9f687022ed724348ccc01fb7b |
|
172f2c0
Skip overallocation calc when not overallocating
chadnetzer Mar 21, 2021
| https://github.com/python/cpython/pull/24954/commits/172f2c0a4014805890ec7cbd16ea3625a569e249 |
|
d76ae2a
Fix list_extend() init list changes to PEP-7 form
chadnetzer Mar 22, 2021
| https://github.com/python/cpython/pull/24954/commits/d76ae2a9adb9892514e804a47b77cd5738ff5195 |
|
7aad246
bpo-43574: Add NEWS
chadnetzer Mar 22, 2021
| https://github.com/python/cpython/pull/24954/commits/7aad246f17772e19d115a1dcd8f670dfa92fb22d |
|
7c20c6c
Add more list overallocation regression tests
chadnetzer Mar 22, 2021
| https://github.com/python/cpython/pull/24954/commits/7c20c6cc15873cbbc7f94c06727ce1f85c27b855 |
|
7be3ae8
Put common-case first in logical-or list_resize()
chadnetzer Mar 22, 2021
| https://github.com/python/cpython/pull/24954/commits/7be3ae871e2e435fbe67c372c3dfaeca8cfa0927 |
|
7436223
Adjust NEWS entry language based on PR feedback
chadnetzer Mar 23, 2021
| https://github.com/python/cpython/pull/24954/commits/7436223a71b2ed46fff050d956d5effa5acbd549 |
|
657d51f
Allow empty list append/insert to overallocate
chadnetzer Mar 24, 2021
| https://github.com/python/cpython/pull/24954/commits/657d51fcb25d7653fff91c044fde3452b2bce056 |
|
4336cc6
Update test_overallocation of empty list append()
chadnetzer Mar 26, 2021
| https://github.com/python/cpython/pull/24954/commits/4336cc6060188b1af9976dd785696b53b865031e |
|
19d4374
Add direct test of list-literal non-overallocation
chadnetzer Apr 5, 2021
| https://github.com/python/cpython/pull/24954/commits/19d43741f7cf16a1bf6e9a9094e469836a3d5c4d |
|
Clear filters
| https://github.com/python/cpython/pull/24954/files |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
|
test_list.py
| https://github.com/python/cpython/pull/24954/files#diff-af5c4ee62cca27529efe0febc3babfd5745cc1ae48a280a58605a8c85ee38942 |
|
2021-03-21-18-51-30.bpo-43574.mteI-I.rst
| https://github.com/python/cpython/pull/24954/files#diff-38a6ab0241f049dd9acd736bb895e992baed7c815cd553bd77b4926b04bb7656 |
|
listobject.c
| https://github.com/python/cpython/pull/24954/files#diff-67a42c5c0990c7aceea040ffc07905299aab97d64dc49adb256f85340b2c7e81 |
| Lib/test/test_list.py | https://github.com/python/cpython/pull/24954/files#diff-af5c4ee62cca27529efe0febc3babfd5745cc1ae48a280a58605a8c85ee38942 |
|
View file
| https://github.com/chadnetzer/cpython/blob/19d43741f7cf16a1bf6e9a9094e469836a3d5c4d/Lib/test/test_list.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/24954/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/24954/files#diff-af5c4ee62cca27529efe0febc3babfd5745cc1ae48a280a58605a8c85ee38942 |
|
| https://github.com/python/cpython/pull/24954/files#diff-af5c4ee62cca27529efe0febc3babfd5745cc1ae48a280a58605a8c85ee38942 |
|
| https://github.com/python/cpython/pull/24954/files#diff-af5c4ee62cca27529efe0febc3babfd5745cc1ae48a280a58605a8c85ee38942 |
| gpshead | https://github.com/gpshead |
| Apr 11, 2021 | https://github.com/python/cpython/pull/24954/files#r611250698 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
| gpshead | https://github.com/gpshead |
| Apr 11, 2021 | https://github.com/python/cpython/pull/24954/files#r611250589 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
| sweeneyde | https://github.com/sweeneyde |
| Apr 11, 2021 | https://github.com/python/cpython/pull/24954/files#r611253116 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
| gpshead | https://github.com/gpshead |
| Apr 11, 2021 | https://github.com/python/cpython/pull/24954/files#r611250374 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
| gpshead | https://github.com/gpshead |
| Apr 11, 2021 | https://github.com/python/cpython/pull/24954/files#r611250284 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
| gpshead | https://github.com/gpshead |
| Apr 11, 2021 | https://github.com/python/cpython/pull/24954/files#r611250669 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
|
| https://github.com/python/cpython/pull/24954/files#diff-af5c4ee62cca27529efe0febc3babfd5745cc1ae48a280a58605a8c85ee38942 |
| Misc/NEWS.d/next/Core and Builtins/2021-03-21-18-51-30.bpo-43574.mteI-I.rst | https://github.com/python/cpython/pull/24954/files#diff-38a6ab0241f049dd9acd736bb895e992baed7c815cd553bd77b4926b04bb7656 |
|
View file
| https://github.com/chadnetzer/cpython/blob/19d43741f7cf16a1bf6e9a9094e469836a3d5c4d/Misc/NEWS.d/next/Core%20and%20Builtins/2021-03-21-18-51-30.bpo-43574.mteI-I.rst |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/24954/{{ revealButtonHref }} |
| gpshead | https://github.com/gpshead |
| Apr 11, 2021 | https://github.com/python/cpython/pull/24954/files#r611250768 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/cpython/pull/24954/files |
| Objects/listobject.c | https://github.com/python/cpython/pull/24954/files#diff-67a42c5c0990c7aceea040ffc07905299aab97d64dc49adb256f85340b2c7e81 |
|
View file
| https://github.com/chadnetzer/cpython/blob/19d43741f7cf16a1bf6e9a9094e469836a3d5c4d/Objects/listobject.c |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/24954/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/24954/files#diff-67a42c5c0990c7aceea040ffc07905299aab97d64dc49adb256f85340b2c7e81 |
|
| https://github.com/python/cpython/pull/24954/files#diff-67a42c5c0990c7aceea040ffc07905299aab97d64dc49adb256f85340b2c7e81 |
|
| 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 |