Last active
October 12, 2015 21:27
-
-
Save c0ldlimit/4089136 to your computer and use it in GitHub Desktop.
Python: Append Dict to Dict #python #dict #append
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
# append dict extra to dict orig | |
orig.update(extra) | |
# make new dict with blend of both | |
dest = dict(orig) # or dict(**orig) or dict.copy() | |
dest.update(extra) | |
# Reference: | |
# http://stackoverflow.com/questions/8930915/python-append-dictionary-to-dictionary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment