Repository navigation
Conversation
None of IntegerValue, FloatValue, BoolValue, or DateTimeValue were ever checked by type, and StringValue had a single check in _format.py. Dropping the five fieldless subclasses simplifies Value, removes generic boilerplate, avoids throwaway ScalarValue allocation when scanning quoted keys, and lets _canon_value return early for scalars. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e943f73b-5c95-4409-8a90-50d0a84ad054
Replace the type(self) switch in Slot.__deepcopy__ with polymorphic overrides on KVSlot and StructuralHeaderSlot, matching render() so each subclass keeps its copy logic alongside its slots and __init__. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e943f73b-5c95-4409-8a90-50d0a84ad054
CommaItem, InlineTableEntry, and CommaValue previously called copy.deepcopy on every trivia string, boolean flag, and key tuple, unlike Slot.__deepcopy__ which shares them directly. Sharing immutable fields directly removes redundant deepcopy calls (~56% faster on test_clone_section_with_inline_value, ~28% faster on formatted-table copies) while keeping full isolation for items, nested values, and mutable scalar payloads. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e943f73b-5c95-4409-8a90-50d0a84ad054
Replace the character-by-character loops in _format._literal_eligible and _scanner.skip_inline_ws with compiled regexes, matching the surrounding style in both modules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e943f73b-5c95-4409-8a90-50d0a84ad054
Share slice-assignment preparation between Array.__setitem__ and AoT.__setitem__, normalise AoT integer indices at the AoT boundary, and pass already-normalised ranges into assign_aot_entries so slices are only normalised once. Remove the redundant _norm_aot_index and remove_aot_entry wrappers from _layout_ops. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e943f73b-5c95-4409-8a90-50d0a84ad054
Replace reorder_container with sort_container so attached section sorting walks owned_slots once to both partition keys into pure-leaf / mixed / pure-section groups and collect movable slots, avoiding the prior binding_refs scan. Remove the now-redundant detached guard in binding_refs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e943f73b-5c95-4409-8a90-50d0a84ad054
Promote _layout_ops._separator_end to _trivia.separator_end so _format._canon_leading can reuse it instead of splitting and rejoining lines. Replace the single use of split_above_block in _format with split_eol_section + leading_break and remove split_above_block and _pad_above_from. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e943f73b-5c95-4409-8a90-50d0a84ad054
Inline _file_synthetic_header_and_kv into its sole remaining caller (_synthesise_header_then_insert_kv) and drop the unused capture parameter on add_aot_entry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e943f73b-5c95-4409-8a90-50d0a84ad054
- Replace 10 deferred _container imports in _array.py and _layout_ops.py with attribute access on the already-imported _container module. - Drop unused return values on _assemble_document, _validate_comment_str, adopt_private_block, adopt_private_implicit, and clone_implicit_section. - Remove always-passed defaults on internal helpers and prune 5 unused entries from internal __all__ lists. - Narrow _prepare_slice_assignment's target parameter from Sequence[Any] to Sequence[object]. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e943f73b-5c95-4409-8a90-50d0a84ad054
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.