コード例 #1
0
 def __eq__(self, o):
     if isinstance(o, AST):
         return self.type == o.type and UserList.__eq__(self, o)
     else:
         # Don't forbid other types since we may try to compare AST with
         # Tokens.
         return self.type == o
コード例 #2
0
 def __init__(self, type, kids=[]):
     self.type = intern(str(type))
     UserList.__init__(self, kids)