Repository navigation
Preserve all values in OrderedMultiDict self-extension - #605
Closed
Gabrieljr42 wants to merge 1 commit into
Closed
Gabrieljr42 wants to merge 1 commit into
Gabrieljr42 wants to merge 1 commit into
Conversation
Owner
|
Folded into #610 (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
…d#605) Workstream-Session-Id: 01a1743e-7af6-7000-999f-e3695b3279ef Workstream-Plan-Id: 2026-10-25-7167a83d96
blebo
pushed a commit
to blebo/boltons
that referenced
this pull request
Nov 1, 2026
…hmoud#608 to 26.3.0 Workstream-Session-Id: 01a1743e-7af6-7000-999f-e3695b3279ef Workstream-Plan-Id: 2026-10-25-7167a83d96
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
OrderedMultiDict.update_extend()appends every value when its source is another multimap, but self-update only appends each key's latest value. Snapshotitems(multi=True)in the self case so repeated values and their insertion order are preserved without iterating a changing linked list.For example, self-updating
[('a', 1), ('b', 2), ('a', 3)]now appends that full sequence, rather than just[('a', 3), ('b', 2)].The regression fails on the original source. Validation: 681 tests and module doctests pass with
tox -e py314; 33 dictionary tests also pass in a separate verification run. Python 3.14 reports five deprecation warnings.The backstory
This is a first contribution to boltons, prepared with Codex in response to the contributor's request to find five more small open-source fixes. Comparing self-updates with updates from a separate multimap exposed the difference. It was found through source inspection and a local reproduction, rather than production use of the library.
AI assistance
Implementation-agent prompts