Visitar URL original
gh-158592: Skip reallocation when shrinking a small list by corona10 · Pull Request #158787 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Apply suggestion from @picnixz"
This reverts commit 134f2fd.
  • Loading branch information
corona10 committed Oct 5, 2026
commit dd855fdf74dbf62e60d2212a88b2d1f1a0717204
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
Skip the array reallocation when shrinking a small :class:`list`-
When deleting an item from a list via :keyword:`del`, lists are
also now correctly reallocated unless small, thereby avoiding
holding memory for too long. Patch by Donghee Na.
Skip the array reallocation when shrinking a small :class:`list`. Patch by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But large arrays are re-allocated! This PR solves a bug (feature?), which should be in the news entry.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eendebakpt NEWS.d of https://github.com/python/cpython/pull/158602will cover this. In Core team Discord @picnixz and I decide to merge in separated PR.

Donghee Na.
Comment thread
corona10 marked this conversation as resolved.
Loading