-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch to replace syntax that's incompatible with Python 3.4
Unpacking a dictionary inside a dictionary display was only introduced in PEP 448 in Python 3.5
- Loading branch information
Showing
5 changed files
with
28 additions
and
7 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
def merge_dicts(*dict_args, **extra_entries): | ||
""" | ||
Given an arbitrary number of dictionaries, merge them into a | ||
single new dictionary. Later dictionaries take precedence if | ||
a key is shared by multiple dictionaries. | ||
Extra entries can also be provided via kwargs. These entries | ||
have the highest precedence. | ||
""" | ||
res = {} | ||
|
||
for d in dict_args + (extra_entries,): | ||
res.update(d) | ||
|
||
return res |
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