Created
March 3, 2015 16:54
-
-
Save AmaxJ/270069aef9e7b95e2924 to your computer and use it in GitHub Desktop.
dictionary inception
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
def inception(dictionary): | |
if isinstance(dictionary, dict): | |
new_dict = {key:value for key, value in dictionary.items()} | |
dictionary['self'] = new_dict | |
return dictionary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment