Returns the old value of the named argument without replacing it. Returns ``default`` if the argument is not present.
(
self, args: Sequence[Any], kwargs: Dict[str, Any], default: Any = None
)
| 385 | raise |
| 386 | |
| 387 | def get_old_value( |
| 388 | self, args: Sequence[Any], kwargs: Dict[str, Any], default: Any = None |
| 389 | ) -> Any: |
| 390 | """Returns the old value of the named argument without replacing it. |
| 391 | |
| 392 | Returns ``default`` if the argument is not present. |
| 393 | """ |
| 394 | if self.arg_pos is not None and len(args) > self.arg_pos: |
| 395 | return args[self.arg_pos] |
| 396 | else: |
| 397 | return kwargs.get(self.name, default) |
| 398 | |
| 399 | def replace( |
| 400 | self, new_value: Any, args: Sequence[Any], kwargs: Dict[str, Any] |