Skip to content

Preserve OrderedDict order in memoization keys - #82

Merged
dgilland merged 1 commit into
dgilland:masterfrom
Aschenbath:fix/oss-20-more-20261125-77d1-ordered-mapping-keys
Nov 25, 2026
Merged

dgilland merged 1 commit into
dgilland:masterfrom
Aschenbath:fix/oss-20-more-20261125-77d1-ordered-mapping-keys

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Two OrderedDict arguments with the same entries in a different order compare unequal, but memoization currently freezes both to the same unordered key. A function that reads their order therefore returns the first call's result for the second input, including after move_to_end().

Freeze ordered mappings as tagged, ordered item sequences. Equal ordered mappings still share entries, nested values and cycles retain their existing handling, and ordinary dictionaries keep their existing order-insensitive keys.

Validation: six regression cases fail on unchanged master. All 425 tests pass with 100% coverage on Python 3.10–3.14; Ruff, mypy, package build, and Sphinx with warnings as errors pass.

Prepared with AI assistance and verified with the checks above.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — Aschenbath:fix/oss-20-more-20261125-77d1-ordered-mapping-keys into dgilland:master

@dgilland
dgilland merged commit 5d9345f into dgilland:master Nov 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants