Skip to content

Allow same-key updates with duplicate conversion checks - #340

Open
muneikh wants to merge 1 commit into
cdgriffith:developfrom
muneikh:fix-duplicate-check-on-reassignment
Open

muneikh wants to merge 1 commit into
cdgriffith:developfrom
muneikh:fix-duplicate-check-on-reassignment

Conversation

@muneikh

@muneikh muneikh commented Oct 11, 2026

Copy link
Copy Markdown

With box_duplicates="error", reassigning an existing converted key incorrectly raises a duplicate-attribute error. With "warn", the same update produces a warning. For example, b = Box({"a b": 1}, box_duplicates="error"); b["a b"] = 2 fails because the existing safe alias is treated as a different conflicting key.

Only flag a conversion duplicate when the alias points to a different original key. Tests cover dictionary and attribute updates under both policies, then verify that a genuinely different colliding key still raises or warns. The changelog and author list are updated per the contribution guide.

Validation: all four new cases fail before the fix; the complete suite passes after it on Python 3.13 (163 tests) with the Cython build and required format backends. The configured Black 24.10 whole-tree check and Mypy (8 source files) pass; git diff --check passes. The PR targets the required develop branch.

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.

1 participant