| 1 |
name: get_variable |
| 2 |
returns: any |
| 3 |
description: | |
| 4 |
This function can be used to dynamically obtain a variable. `res = |
| 5 |
get_variable(varname, fallback)` takes the value of `varname` (which |
| 6 |
must be a string) and stores the variable of that name into `res`. If |
| 7 |
the variable does not exist, the variable `fallback` is stored to |
| 8 |
`res`instead. If a fallback is not specified, then attempting to read |
| 9 |
a non-existing variable will cause a fatal error. |
| 10 |
|
| 11 |
arg_flattening: false |
| 12 |
|
| 13 |
posargs: |
| 14 |
variable_name: |
| 15 |
type: str |
| 16 |
description: Name of the variable to get |
| 17 |
|
| 18 |
optargs: |
| 19 |
default: |
| 20 |
type: any |
| 21 |
description: Fallback value to return when the variable does not exist |