Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make predefined merge strategies work with built-in collections subtypes #25

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

pabloge
Copy link
Contributor

@pabloge pabloge commented Dec 15, 2023

Currently the predefined merge strategies for dicts, lists and sets are not being applied when the objects to be merged are different subtypes of those base types.

For instance, two dicts can be merged. Even a dict with an OrderedDict, or viceversa. But an OrderedDict and a defaultdict are treated as two completely different types and the conflict strategy is applied, although they could perfectly be merged as dicts, as they are both subtypes of dict and behave as such.

This PR allows subtypes of the base collections to be merged according to the strategies defined for them.

@pabloge pabloge mentioned this pull request Dec 18, 2023
Copy link
Owner

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@toumorokoshi toumorokoshi merged commit 98ec8c1 into toumorokoshi:master Dec 18, 2023
3 of 4 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.

2 participants