Exemplo n.º 1
0
 def transform_isinstance(self, node, results):
     x = results["x"].clone() # The thing inside of type()
     T = results["T"].clone() # The type being compared against
     x.set_prefix("")
     T.set_prefix(" ")
     test = Call(Name("isinstance"), [x, Comma(), T])
     if "n" in results:
         test.set_prefix(" ")
         test = Node(syms.not_test, [Name("not"), test])
     test.set_prefix(node.get_prefix())
     return test