def __set_parameter(self, name, state):
        "Set the state of a child Parameter."
        attr = self.__original.get(name)
        for type_, value in state.items():
            if isinstance(attr, Parameter):
                try:
                    attr.validate(value)
                except TypeError:
                    pass
                else:
                    if value == attr.value:
                        self.__dynamic.pop(name, None)
                    else:
                        self.__dynamic[name] = value
                    continue
            if not isinstance(value, type_):
                raise TypeError(repr(name) + ' has bad type!')
            self.__static.setdefault(name, {}).setdefault(Parameter, {}) \
                [type_] = value
Set the state of a child Parameter.
recipes/Python/578195_Setting_Namespaces/recipe-578195.py