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
from UserDict import IterableUserDict | |
import collections | |
__author__ = 'github.com/hangtwenty' | |
def tupperware(mapping): | |
""" Convert mappings to 'tupperwares' recursively. |
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
from UserDict import IterableUserDict | |
import collections | |
def tupperware(mapping): | |
""" Convert mappings to 'tupperwares' recursively. | |
Lets you use dicts like they're JavaScript Object Literals (~=JSON)... | |
It recursively turns mappings (dictionaries) into namedtuples. | |
Thus, you can cheaply create an object whose attributes are accessible |