def __delattr__(self, name): # Names starting with an underscore are not preferences but normal # instance attributes if name.startswith('_'): MutableMapping.__delattr__(self, name) else: del self._all_prefs[self._basename + '.' + name]
def __delattr__(self, name): if 'pref_register' in self.__dict__ and name in self.pref_register: raise PreferenceError("Cannot delete a preference category.") else: MutableMapping.__delattr__(self, name, value)