Update an existing positional argument to contain the new value ``arg``. After calling, ``self.args[idx] == arg``. Args: idx (int): The index into ``self.args`` of the element to update arg (Argument): The new argument value to write into ``args``
(self, idx : int, arg : Argument)
| 353 | |
| 354 | @compatibility(is_backward_compatible=True) |
| 355 | def update_arg(self, idx : int, arg : Argument) -> None: |
| 356 | """ |
| 357 | Update an existing positional argument to contain the new value |
| 358 | ``arg``. After calling, ``self.args[idx] == arg``. |
| 359 | |
| 360 | Args: |
| 361 | |
| 362 | idx (int): The index into ``self.args`` of the element to update |
| 363 | arg (Argument): The new argument value to write into ``args`` |
| 364 | """ |
| 365 | args = list(self.args) |
| 366 | args[idx] = arg |
| 367 | self.args = tuple(args) |
| 368 | |
| 369 | @compatibility(is_backward_compatible=True) |
| 370 | def insert_arg(self, idx : int, arg : Argument) -> None: |