code: def ancestors(self, typename):
          
          xs = []
          for parent in self._hier[typename][0]:
              xs.append(parent)
              xs.extend(self.ancestors(parent))
          return xs
docs: Return the ancestor types of *typename*.