Jiaaro

…on life, the universe, and everything

Making Python Objects that act like Javascript Objects

Been writing a lot of javascript and I thought this was neat:

class JsObject(dict):
    def __init__(self, *args, **kwargs):
        super(JsObject, self).__init__(*args, **kwargs)
        self.__dict__ = self