Skip to content

Instantly share code, notes, and snippets.

@AmaxJ
Created March 3, 2015 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AmaxJ/270069aef9e7b95e2924 to your computer and use it in GitHub Desktop.
Save AmaxJ/270069aef9e7b95e2924 to your computer and use it in GitHub Desktop.
dictionary inception
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