René's URL Explorer Experiment


Title: `del list[index]` never reallocates the array · Issue #158592 · python/cpython · GitHub

Open Graph Title: `del list[index]` never reallocates the array · Issue #158592 · python/cpython

X Title: `del list[index]` never reallocates the array · Issue #158592 · python/cpython

Description: Bug report This works as expected: >>> import sys >>> seq = list(range(1000)) >>> sys.getsizeof(seq) 8056 >>> for _ in range(1000): ... seq.pop() >>> sys.getsizeof(seq) 56 But this does not: >>> import sys >>> seq = list(range(1000)) >>>...

Open Graph Description: Bug report This works as expected: >>> import sys >>> seq = list(range(1000)) >>> sys.getsizeof(seq) 8056 >>> for _ in range(1000): ... seq.pop() >>> sys.getsizeof(seq) 56 But this does not: >>> im...

X Description: Bug report This works as expected: >>> import sys >>> seq = list(range(1000)) >>> sys.getsizeof(seq) 8056 >>> for _ in range(1000): ... seq.pop() >>> sy...

Opengraph URL: https://github.com/python/cpython/issues/158592

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`del list[index]` never reallocates the array","articleBody":"### Bug report\n\nThis works as expected:\n\n```python\n>>> import sys\n>>> seq = list(range(1000))\n>>> sys.getsizeof(seq)\n8056\n>>> for _ in range(1000):\n...     seq.pop()\n>>> sys.getsizeof(seq)\n56\n```\n\nBut this does not:\n\n```python\n>>> import sys\n>>> seq = list(range(1000))\n>>> sys.getsizeof(seq)\n8056\n>>> for _ in range(1000):\n...     del seq[-1]\n>>> sys.getsizeof(seq)\n8056\n```\n\nPerhaps a regression from #115605 (note that the `list_ass_slice()` call has been replaced with a separate implementation).\n\n### CPython versions tested on:\n\n3.13, 3.14, 3.15, CPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-158602\n* gh-158787\n* gh-159001\n* gh-159002\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/x42005e1f","@type":"Person","name":"x42005e1f"},"datePublished":"2026-10-02T06:39:31Z","url":"https://github.com/python/cpython/issues/158592"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7d8a3860-41cc-aae7-2c9f-0464e27b1b2a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8C74:D1D28:186B1E4:205DAD7:6B021097
html-safe-nonced6b4cee37e6c3c0984732286b68213075a94afe40a5fb5adffbe48a3080617c6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Qzc0OkQxRDI4OjE4NkIxRTQ6MjA1REFENzo2QjAyMTA5NyIsInZpc2l0b3JfaWQiOiI4MDIyMDkyNDEwNjMwODM2Mzc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9bce8264f23932f1dd4a6be95b6e1452a8129748c310ee57040d088fb6ee50be
hovercard-subject-tagissue:5673868700
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/158592/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3ec6d0653120f0e90262c7312bbc10abfd7d1731fafb7ad3a1ef33691a79a794/python/cpython/issues/158592
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3ec6d0653120f0e90262c7312bbc10abfd7d1731fafb7ad3a1ef33691a79a794/python/cpython/issues/158592
og:image:altBug report This works as expected: >>> import sys >>> seq = list(range(1000)) >>> sys.getsizeof(seq) 8056 >>> for _ in range(1000): ... seq.pop() >>> sys.getsizeof(seq) 56 But this does not: >>> im...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamex42005e1f
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/158592#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F158592
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F158592
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/158592
Reloadhttps://github.com/python/cpython/issues/158592
Reloadhttps://github.com/python/cpython/issues/158592
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/158592
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/158592
del list[index] never reallocates the arrayhttps://github.com/python/cpython/issues/158592#top
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
3.16new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.16%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
type-refactorCode refactoring (with no changes in behavior)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-refactor%22
https://github.com/x42005e1f
x42005e1fhttps://github.com/x42005e1f
on Oct 2, 2026https://github.com/python/cpython/issues/158592#issue-5673868700
#115605https://github.com/python/cpython/pull/115605
gh-158592: Reallocate the list's array when deleting by index #158602https://github.com/python/cpython/pull/158602
gh-158592: Skip reallocation when shrinking a small list #158787https://github.com/python/cpython/pull/158787
[3.15] gh-158592: Skip reallocation when shrinking a small list (GH-158787) #159001https://github.com/python/cpython/pull/159001
[3.14] gh-158592: Skip reallocation when shrinking a small list (GH-158787) #159002https://github.com/python/cpython/pull/159002
x42005e1fhttps://github.com/x42005e1f
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Oct 2, 2026https://github.com/python/cpython/issues/158592#event-32314282592
aiskhttps://github.com/aisk
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
on Oct 2, 2026https://github.com/python/cpython/issues/158592#event-32319921718
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 2, 2026https://github.com/python/cpython/issues/158592#issuecomment-5950218337
picnixzhttps://github.com/picnixz
pendingThe issue will be closed if no feedback is providedhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22pending%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Oct 2, 2026https://github.com/python/cpython/issues/158592#event-32326183486
https://github.com/x42005e1f
x42005e1fhttps://github.com/x42005e1f
on Oct 2, 2026https://github.com/python/cpython/issues/158592#issuecomment-5950456041
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 2, 2026https://github.com/python/cpython/issues/158592#issuecomment-5950555053
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 2, 2026https://github.com/python/cpython/issues/158592#issuecomment-5950601951
picnixzhttps://github.com/picnixz
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
type-refactorCode refactoring (with no changes in behavior)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-refactor%22
3.16new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.16%22
pendingThe issue will be closed if no feedback is providedhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22pending%22
on Oct 2, 2026https://github.com/python/cpython/issues/158592#event-32327332113
https://github.com/x42005e1f
x42005e1fhttps://github.com/x42005e1f
on Oct 2, 2026https://github.com/python/cpython/issues/158592#issuecomment-5950616872
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Oct 2, 2026https://github.com/python/cpython/issues/158592#issuecomment-5950851716
PEP-7https://peps.python.org/7
PEP-7https://peps.python.org/7
PEP-8https://peps.python.org/8
picnixzhttps://github.com/picnixz
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
on Oct 3, 2026https://github.com/python/cpython/issues/158592#event-32402972324
corona10https://github.com/corona10
on Oct 4, 2026https://github.com/python/cpython/issues/158592#event-32425977315
pythongh-158592: Skip reallocation when shrinking a small listhttps://github.com/corona10/cpython/commit/0448de37e8b7d68b484d6f359967c906e0593b1d
pythongh-158592https://github.com/python/cpython/issues/158592
0448de3https://github.com/corona10/cpython/commit/0448de37e8b7d68b484d6f359967c906e0593b1d
pythongh-158592: Skip reallocation when shrinking a small listhttps://github.com/corona10/cpython/commit/bbad8e9d3929e13f90d2c6d5fe262e5fbbb814af
pythongh-158592https://github.com/python/cpython/issues/158592
bbad8e9https://github.com/corona10/cpython/commit/bbad8e9d3929e13f90d2c6d5fe262e5fbbb814af
Merge branch 'main' into pythongh-158592https://github.com/corona10/cpython/commit/f01205b7526614e75bb17decfafaf08de0cafb3a
pythongh-158592https://github.com/python/cpython/issues/158592
f01205bhttps://github.com/corona10/cpython/commit/f01205b7526614e75bb17decfafaf08de0cafb3a
gh-158592: Reallocate the list's array when deleting by index (gh-158602https://github.com/python/cpython/commit/12fbc90e063b118f489241ae9f806a9d694a5682
gh-158592https://github.com/python/cpython/issues/158592
gh-158602https://github.com/python/cpython/pull/158602
12fbc90https://github.com/python/cpython/commit/12fbc90e063b118f489241ae9f806a9d694a5682
gh-158592: Skip reallocation when shrinking a small list (gh-158787)https://github.com/python/cpython/commit/cdfdf7bb73a5751ecec7d2780e3f34ec60699fb1
gh-158592https://github.com/python/cpython/issues/158592
gh-158787https://github.com/python/cpython/pull/158787
cdfdf7bhttps://github.com/python/cpython/commit/cdfdf7bb73a5751ecec7d2780e3f34ec60699fb1
[3.14] gh-158592: Skip reallocation when shrinking a small list (GH-1…https://github.com/python/cpython/commit/2d2b37f99ae9b70cce847d15ce2b99334eb07931
gh-158592https://github.com/python/cpython/issues/158592
GH-1…https://github.com/python/cpython/pull/158787
2d2b37fhttps://github.com/python/cpython/commit/2d2b37f99ae9b70cce847d15ce2b99334eb07931
[3.15] gh-158592: Skip reallocation when shrinking a small list (GH-1…https://github.com/python/cpython/commit/e431a7a72312468d853f0e46353193d969017eca
gh-158592https://github.com/python/cpython/issues/158592
GH-1…https://github.com/python/cpython/pull/158787
e431a7ahttps://github.com/python/cpython/commit/e431a7a72312468d853f0e46353193d969017eca
https://github.com/corona10
corona10https://github.com/corona10
on Oct 10, 2026https://github.com/python/cpython/issues/158592#issuecomment-6091653056
@x42005e1fhttps://github.com/x42005e1f
corona10https://github.com/corona10
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 10, 2026https://github.com/python/cpython/issues/158592#event-32918285898
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/158592
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/158592
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
3.16new features, bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.16%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
type-refactorCode refactoring (with no changes in behavior)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-refactor%22
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.