def swap_args(self, new_args, new_length=None):
if len(self.args) == len(new_args) and all(a is b for a,b in zip(self.args, new_args)):<EOL><INDENT>return self<EOL><DEDENT>length = self.length if new_length is None else new_length<EOL>a = self.__class__(self.op, new_args, length=length)<EOL>return a<EOL>
This returns the same AST, with the arguments swapped out for new_args.