+ self.visit(type, *args, **kwargs)
+
+
+class Collector(Traverser):
+ '''Visitor which collects all unique types as it traverses them.'''
+
+ def __init__(self):
+ self.__visited = set()
+ self.types = []
+
+ def visit(self, type):
+ if type in self.__visited:
+ return
+ self.__visited.add(type)
+ Visitor.visit(self, type)
+ self.types.append(type)
+