Пример #1
0
  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
Пример #2
0
 def testReverseSlotMapping(self):
     slots.ReverseSlotMapping().get("__radd__")  # smoke test