Allows the 'in' operator to work for checking if a particular key (or keypath)
        is inside the dictionary.

def contains(self, key_or_keypath):
        """ Allows the 'in' operator to work for checking if a particular key (or keypath)
        is inside the dictionary. """
        if isinstance(key_or_keypath, list):
            if len(key_or_keypath) == 0:
                # empty list is root
                return False
            val = self 
            next_key = None
            for next_key in key_or_keypath:
                if next_key in val:
                    val = val[next_key]
                else:
                    return False
            return True
        else:
            return key_or_keypath in self.__dict__['p']