def as_dict(self): config = {} for name in self.PUBLIC_ATTRIBUTES: attr = getattr(self, name) config[name] = to_dict(attr) return config
def as_dict(self): return {name: to_dict(getattr(self, name)) for name in self.__slots__}
def as_dict(self): return { name: to_dict(getattr(self, name)) for name in self.__slots__ }