def __init__(self, matcher): """Initialize this visitor. Args: matcher: A class with a "Match" method, used for matching function argument types. """ super(ExtractOperators, self).__init__() # class name -> op name -> list of signatures self.operators = collections.defaultdict( lambda: collections.defaultdict(list)) self._slots = slots.ReverseSlotMapping() self.matcher = matcher
def testReverseSlotMapping(self): slots.ReverseSlotMapping().get("__radd__") # smoke test