Repository navigation
Conversation
Owner
|
Folded into #609 (see the PR description for credit). Thanks for the report and the repro. |
blebo
pushed a commit
to blebo/boltons
that referenced
this pull request
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The change
Fix
BarrelList's in-place repetition (*= n). It currently inheritslist.__imul__, which operates on the unused base-list storage instead ofBarrelList.lists:The implementation uses native list repetition on the actual contents, retains the same
BarrelListobject, then rebalances its storage. It normalizes__index__before copying multi-barrel contents, preserves shallow element sharing, and delegates invalid-count/overflow behavior to the native list operation. Other list operators are unchanged. This branch is based directly on upstream master and does not depend on #517 or #530.Tests and validation
Dedicated Conda Python 3.13.15 environment on Windows:
listutils.py, andpip check: passed. No repository-wide formatting changes were made.Other Python versions/operating systems and remote CI are not claimed as passing from this local run.
The backstory
Related contribution: #517 (self-extension). This separate inherited-list mutation issue was found during agent-assisted checks of
BarrelList's advertised list-compatible behavior, not from a production incident. Reviewing the storage split made it clear why delegating to the inherited method could silently leave the visible sequence unchanged.AI assistance