Skip to content

Compare literal dictionary keys in is_equal_with - #370

Merged
dgilland merged 2 commits into
dgilland:developfrom
KennyMcSimpson:fix/equality-literal-dictionary-keys
Oct 27, 2026
Merged

dgilland merged 2 commits into
dgilland:developfrom
KennyMcSimpson:fix/equality-literal-dictionary-keys

Conversation

@KennyMcSimpson

Copy link
Copy Markdown
Contributor

When a customizer requests fallback comparison, is_equal_with treats
dictionary keys as paths through has(). Equal literal keys such as a.b
or a[0] can compare unequal; a different nested structure or an integer
key corresponding to a numeric string can instead raise KeyError.

Check dictionary membership directly, while retaining list-index comparison
and explicit customizer results. Add eight cases covering literal keys,
nested values and mismatches, symmetry, the curried API, and controls. Also
include the changelog and contributor entry requested by the guide.

Validation: all 2,888 unit/doctest tests pass with 100% coverage on Python
3.10 through 3.14. Full Ruff/format, MyPy, strict documentation build,
sdist/wheel builds, Twine checks and chaining-type consistency checks pass.
The original source fails six new cases, while two controls pass.

One initial Python 3.10 run hit the unchanged debounce timing test; that
test passed in isolation and the final complete run passed. No timer code
or timing tests are changed.

AI disclosure: This patch, tests and description were prepared with OpenAI
Codex assistance. The reported checks were executed locally.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — KennyMcSimpson:fix/equality-literal-dictionary-keys into dgilland:develop

@dgilland
dgilland merged commit 2b85153 into dgilland:develop Oct 27, 2026
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