def GetSubList(self): sublist = [] for key in self.object.keys(): try: value = self.object[key] except KeyError: continue def setfunction(value, key=key, object=self.object): object[key] = value item = make_objecttreeitem(key + " =", value, setfunction) sublist.append(item) return sublist