Repository navigation
Normalize BoxList in-place repetition counts before comment updates - #361
Merged
cdgriffith merged 5 commits intoNov 13, 2026
Merged
Conversation
cdgriffith
added a commit
that referenced
this pull request
Nov 13, 2026
…mment updates Normalize BoxList in-place repetition counts before comment updates
Merged
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.
Problem
BoxList.__imul__lets the underlying list consume an index-protocol object, then passes the original object to comment repetition. With item comments and a positive count this raisesTypeErrorafter the list has already changed, leaving repeated comments missing. This is on currentdevelop, after the insert/pop/delete fix for #354.Change
Normalize the count with
operator.indexonce, after the frozen check and before mutation, then reuse the integer for list repetition and comment bookkeeping. This preserves invalid-count and frozen-list refusal behavior. Changelog and contributor entry included per CONTRIBUTING.Checks
Linux, CPython 3.12.15, pytest 9.2.0:
box.box_listextension path was checked.No hosted CI result is claimed. This was found by source inspection and local reproduction, not a claimed production incident.