Skip to content

Preserve selected tuple containers during search and merge - #211

Open
awais-ur-rehman wants to merge 1 commit into
dpath-maintainers:masterfrom
awais-ur-rehman:feat/preserve-selected-tuple-containers
Open

awais-ur-rehman wants to merge 1 commit into
dpath-maintainers:masterfrom
awais-ur-rehman:feat/preserve-selected-tuple-containers

Conversation

@awais-ur-rehman

Copy link
Copy Markdown

Summary

A whole-tree search retains selected containers by reference, then redundantly assigns their descendants. For a tuple inside a list, those assignments attempt to mutate the tuple and make search and merge fail. Skip assignments when the selected path already contains the same object.

Fixes #189. The earlier unmerged #205 converted tuples to lists; this keeps their type and existing identity behavior. Partial tuple reconstruction is outside this patch.

Breaking Changes

None.

Testing

  • 81 nose2 tests and Flake8 pass. Both added regressions fail on the base.
  • Source/wheel builds and installed-wheel reproduction pass.
  • To reproduce, merge {"foo": [("bar", "baz")]} into {"foo": []}, and search a nested tuple-containing structure with "**". Values and tuple types must be retained.

Prepared with OpenAI Codex assistance.

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.

[bug] AttributeError: 'tuple' object has no attribute 'extend'

1 participant