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

minor: small doc improvement #29

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ through common data structures and joining results. Although
it's recommended to choose your own strategies, deepmerge does
provided some preconfigured mergers for a common situations:

* deepmerge.always_merger: always try to merge. in the case of mismatches, the value from the second object overrides the first o ne.
* deepmerge.always_merger: always try to merge. in the case of mismatches, the value from the second object overrides the first one.
* deepmerge.merge_or_raise: try to merge, raise an exception if an unmergable situation is encountered.
* deepmerge.conservative_merger: similar to always_merger, but in the case of a conflict, use the existing value.

Expand Down Expand Up @@ -43,6 +43,8 @@ This is intentional, as an implicit copy would result in a significant performan
result = deepcopy(base)
always_merger.merge(result, next)

assert id(result) != id(base)

Authoring your own Mergers
==========================

Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Example

assert expected_result == result

# The merge action will change the first dict (base).
assert id(base) == id(result)

**Custom Strategy**

Expand Down