Repository navigation
Version 8.0.1 - #350
Merged
Merged
Version 8.0.1#350
Conversation
…orting (@HocVoNgThai) Preserve BoxList comments during dotted deletion and sorting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
update() wrote through __convert_and_store directly, skipping the _parse_box_dots traversal that __setitem__ applies, so a key such as 'x.z' was stored as a literal key in parallel to the nested x path — even when x already existed. merge_update already stores through __setitem__ and nests correctly; Box + Box merges through update() and was affected too. update() now routes keys that box_dots would treat as paths through __setitem__; everything else (non-dotted keys, or keys matched by box_dots_exclude) keeps the previous behavior. Fixes #356 Co-authored-by: rahul05ranjan <11793455+rahul05ranjan@users.noreply.github.com>
The out-of-place operators fell through to plain list, dropping the
class, the box options and the conversion of appended items:
BoxList([{'a': 1}]) + [{'b': 2}] -> plain list, second item a raw dict
BoxList([{'a': 1}]) * 2 -> plain list
__add__ and __mul__ now return a BoxList with the same box options;
appended items are converted the same way append/extend convert them,
and a frozen operand produces a frozen result. The in-place variants
were already correct.
Fixes #358
Co-authored-by: rahul05ranjan <11793455+rahul05ranjan@users.noreply.github.com>
… mode Fix update() storing dotted keys literally in box_dots mode
# Conflicts: # test/test_box_list.py
Make BoxList + and * return a BoxList
… reflected multiply Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…und trips Parametrized matrix over every BoxList mutator (plain, box_dots, frozen), box_dots accessor consistency, and copy/deepcopy/pickle round trips of Box, BoxList, ConfigBox, SBox and DDBox with comments. Known bugs are reproduced as strict xfails (run with --runxfail to see them fail). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ied comments - BoxList checks frozen_box on every change; a frozen Box gets its own frozen copy of a BoxList - deepcopy of a frozen Box keeps the nested Boxes frozen - frozen lists (tuples) carry comments and follow box_dots list paths - slice assignment / deletion keep the comments of the other items - BoxList +, *, n *, *= copy item comments - box_dots: pop() default for out of range index, no parent created by failed del, garbage BoxList index rejected, negative index accepted - audit test matrix added; ruff format Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nience test_negative_and_out_of_range_list_indexes asserted that a[-1] raises, which is intended behaviour, not a bug. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…mment updates Normalize BoxList in-place repetition counts before comment updates
Apply configured insertion rules in Box.update # Conflicts: # CHANGES.rst
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Version 8.0.1
Bug fix release for 8.0.0, mostly for BoxList comments and frozen boxes. It also includes two breaking changes to
Box.update()(and the|/|=operators, which use it).Before this release
update()skipped the rules thatbox[key] = valueand theBox(...)constructor follow. It now follows them. Code that relied on the old behavior may end up with different data, or an error, after upgrading. The wiki page Major Version Breaking Changes has before/after examples.update()are paths withbox_dots. Every earlier version (6.x, 7.x, 8.0.0) stored them as literal keys.Box({"a": {"x": 1}}, box_dots=True).update({"a.b": 2})now gives{"a": {"x": 1, "b": 2}}. Previously it gave{"a": {"x": 1}, "a.b": 2}.Box(box_dots=True).update({"a.b": 1})now raisesBoxKeyError, asbox["a.b"] = 1already did. Usedefault_box=Trueto create the missing parents.update()applies the Box options for new values.box_recastconverts values, and raisesBoxValueErrorif a value can't be converted.camel_killer_boxconverts keys, soupdate(TimeOut=2)replacestime_outinstead of adding a second key.box_duplicateschecks keys.__setitem__is called for every key.Fixes
+and*returned a plain list instead of a BoxList. They now keep item comments,n * BoxListworks, and*accepts objects with__index__.insert,pop,deland*=with an object that has__index__raisedTypeErrorafter changing the list when it had item comments.ConfigBox.merge_updateused up one-shot key/value iterators before merging them.del bl["[0]"], andsort()called thekeyfunction twice when the list had comments.append,extend,insert,pop,remove,clear,sortandreversestill changed it. A frozen Box now gets its own frozen copy.copy.deepcopyof a frozen Box left the nested Boxes mutable.from_yaml(frozen_box=True)dropped the comments on list items. box_dots list paths such as"l[0].x"now work in a frozen Box.Box.pop(path, default)raisedIndexErrorfor an out-of-range list index in a box_dots path. It now returns the default, likeget().delcreated the parent key whendefault_box_create_on_getwas on."[x][1]"were accepted and acted on the wrong item. They now raiseBoxTypeError.Merged pull requests
#349, #351, #353, #355, #357, #359, #360, #361
Thanks to @HocVoNgThai, @Mrun25, @alexbertho, @parijat1222q, @rahul05ranjan, @peterolkhov and @anishpentyala.
Closes #354, closes #356, closes #358
🤖 Generated with Claude Code