diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-13 05:59:05 -0700 |
|---|---|---|
| committer | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-13 05:59:05 -0700 |
| commit | 7b97a7a407cfa407217012b3018bebfcd25b0da7 (patch) | |
| tree | b7c3fd6f393f3b71aea512e65eb9e2312a1492da /python/setup.py | |
| parent | f1a412985288730cc65a250da2bd4f5b87ade43f (diff) | |
| download | vyos-1x-7b97a7a407cfa407217012b3018bebfcd25b0da7.tar.gz vyos-1x-7b97a7a407cfa407217012b3018bebfcd25b0da7.zip | |
config: T8858: fix mutable default argument in config API methods
Four Config class methods used `default=[]` as a parameter default. The
empty list is created once at function-definition time and shared across
all calls; any mutation of the default leaks across callers. This is
mitigated in practice by `_make_path` returning `(self._level + path)`
(which creates a fresh list via `+` rather than mutating via `.append()`),
but the defensive `default=None` + explicit guard is preserved as an
additional safeguard.
Methods touched:
- return_values
- list_nodes
- return_effective_values
- list_effective_nodes
Also document the `default` parameter in each method's docstring `Args:`
section and the corresponding `Returns:` clarifications.
Diffstat (limited to 'python/setup.py')
0 files changed, 0 insertions, 0 deletions
