Skip to content

Write MutableMapping paths through mapping keys - #400

Merged
dgilland merged 1 commit into
dgilland:developfrom
ShahadatTest:fix/mutable-mapping-writes
Nov 1, 2026
Merged

dgilland merged 1 commit into
dgilland:developfrom
ShahadatTest:fix/mutable-mapping-writes

Conversation

@ShahadatTest

Copy link
Copy Markdown
Contributor

Path setters treat UserDict and ChainMap as ordinary objects, assigning attributes instead of mapping entries. This silently leaves the mapping data unchanged. Dispatch mutable mappings through their key interface, including selection of intermediate dictionary containers.

Ten regression cases cover set_/set_with, update/update_with, nested values and integer keys across both standard-library mapping classes. All ten fail before the fix. Python 3.12: 3089 tests pass with 100% coverage. Python 3.10: 3087 pass with the two real-time debounce tests excluded; repeated complete runs hit those existing timing failures, and unchanged upstream reproduces test_debounce. Ruff and source mypy pass. Final diff inspected.

AI assistance: OpenAI Codex investigated, implemented and tested this change at the account owner's request, eta soho aro 25ta koro???. No independent human review is claimed.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — ShahadatTest:fix/mutable-mapping-writes into dgilland:develop

@agammann agammann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked both path-writing branches at ab8a2ee. UserDict and ChainMap now go through their mapping keys, and missing nested paths create dictionaries rather than list-style containers. The ten new cases for set_, set_with, update, and update_with pass locally on Python 3.14.8; I did not run the full suite or supported-version matrix.

@dgilland
dgilland merged commit 3a64d03 into dgilland:develop Nov 1, 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.

4 participants