Title: bpo-43574: Dont overallocate list literals by chadnetzer · Pull Request #24954 · python/cpython · GitHub
Open Graph Title: bpo-43574: Dont overallocate list literals by chadnetzer · Pull Request #24954 · python/cpython
X Title: bpo-43574: Dont overallocate list literals by chadnetzer · Pull Request #24954 · python/cpython
Description: 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 #17984 Commit where over-allocation of list literals first appeared https://bugs.python.org/issue38328 #17114 6dd9b64 This changes to the original behavior of not over-allocating lists for list literals, by not over-allocating any 0-length list that is extended. Technically this is a change in behavior, as lists that are initialized to length 0, and then immediately extended, will not be over-allocated on that initial extension. This change in behavior is likely innocuous, and possibly desirable, whereas the long-standing Python behavior of not using over-allocation for list literals is almost certainly desired. Adds a test_overallocation test for lists to find regressions (assuming the regression doesn't alter the behavior of both the list-literal and list-initialization from a known length). https://bugs.python.org/issue43574
Open Graph Description: 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...
X Description: 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 #...
Opengraph URL: https://github.com/python/cpython/pull/24954
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:e35eea5e-c466-c01f-cd35-6bb2431ddd5e |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | D0CE:C18A5:8B1516:C52CB0:696A5185 |
| html-safe-nonce | cd39ebd62fc29cfe4afbe55df447bbd75bbe0fc0248fbcb7ac91fc1cb46dc2de |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMENFOkMxOEE1OjhCMTUxNjpDNTJDQjA6Njk2QTUxODUiLCJ2aXNpdG9yX2lkIjoiMzEwODI5ODAxMDMyMzk5NzA2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1ea3756c1980a47b434ff7dd49ec8e2d34e066fe7cdad58013741d999089aa2d |
| hovercard-subject-tag | pull_request:597408477 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/24954/checks |
| 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 | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| turbo-cache-control | no-preview |
| 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 full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width