def __setattr__(self, key, value):
<EOL>if isinstance(value, bool) and key in self.__dict__ and isinstance(self.__dict__[key], self.__class__):<EOL><INDENT>self.__dict__[key].set_all_attribute_values(value)<EOL>return<EOL><DEDENT>elif isinstance(value, (bool, self.__class__)):<EOL><INDENT>self.__dict__[key] = value<EOL>return<EOL><DEDENT>raise TypeError("<STR_LIT>" %<EOL>(key, self.__class__.__name__, value.__class__.__name__))<EOL>
Overrides setattr to allow only booleans or an AttributeFilter