def replace_argument(self, name, *args, **kwargs):
new_arg = self.argument_class(name, *args, **kwargs)<EOL>for index, arg in enumerate(self.args[:]):<EOL><INDENT>if new_arg.name == arg.name:<EOL><INDENT>del self.args[index]<EOL>self.args.append(new_arg)<EOL>break<EOL><DEDENT><DEDENT>return self<EOL>
Replace the argument matching the given name with a new version.