Skip to content

fix: assign mutable sequence slices in config paths - #78

Open
Shubham-Padkonde wants to merge 1 commit into
google:masterfrom
Shubham-Padkonde:fix/config-path-slice-assignment
Open

Shubham-Padkonde wants to merge 1 commit into
google:masterfrom
Shubham-Padkonde:fix/config-path-slice-assignment

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

config_path.split and get_value support slice paths, but set_value('data[1:3]', {'data': [...]}, replacement) raises KeyError: its mutable-sequence assignment branch handles integers only and falls through to a membership check for slices.

Handle slices alongside integer indices for mutable sequences, delegating replacement and extended-slice validation to the sequence itself. Tests cover bounded, whole, stepped, and negative slices, plus an invalid extended-slice replacement.

Validation: all five regressions fail before the change. Config-dict and config-flags suites: 390 passed, 8 subtests passed, 1 skipped, 1 deselected. The deselected testFlagfile fails identically on unchanged upstream on Windows because its test command strips backslashes from the temporary path. git diff --check passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant