You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In-place array repetition changes values without updating serialized TOML #646
On current master (858186a), in-place array repetition changes the Python list but leaves the serialized TOML unchanged:
importtomlkitdoc=tomlkit.parse("a = [1, 2]\n")
a=doc["a"]
a*=0asserta== []
print(tomlkit.dumps(doc)) # still a = [1, 2]
With a *= 2, the values become [1, 2, 1, 2], but the document still serializes [1, 2]. Negative repetition similarly clears the list without clearing the rendered values. The array remains the same object attached to the document.
I plan to synchronize this existing list operation by using the array's current clear() / extend() paths, with tests that compare values, serialization and subsequent mutation. This does not change sorting/reordering behavior discussed in #233.
Prepared with AI assistance. I found no repetition-related issue or PR; please flag any overlapping work.
I am working on the narrow synchronization fix and regression tests with AI assistance. The changes will reuse existing array mutation paths and preserve the original array identity; no sorting or slice-assignment behavior changes.
Activity
harbinresearcher commentedon Oct 12, 2026
I am working on the narrow synchronization fix and regression tests with AI assistance. The changes will reuse existing array mutation paths and preserve the original array identity; no sorting or slice-assignment behavior changes.