def level(self, level): """Return a list of all nodes on a given level """ return [x for x in self.nodes if x.level == level]