Repository navigation
Conversation
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.
Summary
In-place list repetition bypasses the storage used to render
ArrayandAoTvalues. For example,a *= 2changes an array's list contents, butdoc.as_string()still writes the original elements;a *= 0also leaves the old values in the serialized document. Arrays of tables similarly retain their original body.Implement in-place repetition through the existing mutable-sequence operations so the list, rendered items, and table body stay synchronized. Preserve the object identity, support integer-index objects, and clear values for nonpositive factors. Add round-trip regressions for single-line/multiline arrays, arrays of tables, and subsequent edits.
Validation on Linux/Python 3.12: 12 cases fail before the fix; all 1,116 tests pass after the fix, including the pinned TOML compliance corpus. Repository-pinned Ruff 0.16.10 lint/format and
git diff --checkpass. Mypy 1.19.1 passes for the changed files. The optional whole-project mypy run reports the same five existing errors on an isolated unmodified checkout; it is not a repository CI step.Agent Drafting Metadata