-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added 'decoupled' kwparam to merge() (closes #115)
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a3516a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Couple of notes:
Suppose we call
conf.merge({'a': {'b': {'c': {'d': 'e'}}}}, decoupled=True)
. We'll end up callingcopy.deepcopy
on{'b': {'c': {'d': 'e'}}}
, then again on{'c': {'d': 'e'}}
, then again on{'d': 'e'}
. Since the docstring explicitly says that it's "paid for by more work... and more memory usage" then I think this inefficiency is probably okay, especially since most of the extra memory from the extra copies will get garbage collected.TestMerging
isn't necessarily testing that the deep copying aspect of the merge is functioning. To test that we'd need to try doing something like